Skip to Main Content

Java Security

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How dynamically add permissions to policy?

843811Jul 17 2001 — edited Jul 18 2001
How do I add "grants" to the policy inside my code? I want to add them programatically. So I want the EQUIVALENT of this:
grant Principal "dan" {
   permission javax.security.auth.AuthPermission "modifyPrincipals";
}

Is there a way to do this? I want to do something like:

java.security.policy.add(new MyPrincipal("dan"), new AuthPermission("modifyPrincipals"));

(I know the above code is wrong, it's merely for explanatory purposes)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 15 2001
Added on Jul 17 2001
1 comment
134 views