views:

28

answers:

1

Is it possible to grant Permissions through something other than a policy file? What I'd like to achieve is a permissions-based system that can be modified at runtime.

+1  A: 

You can install your own security manager,

 System.setSecurityManager(new YourSecurityManager());

In YourSecurityManager, you can read permission from whatever sources you like.

The SecurityManager is used through out Java. You should check with default manager for the permissions you don't care.

Performance is also crucial. SecurityManager is checked quite often in JRE. It can slow down your system to a crawl if not implemented properly.

ZZ Coder