How dynamically add permissions to policy?
843811Jul 17 2001 — edited Jul 18 2001How 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)