List of usage examples for java.security AccessControlException AccessControlException
public AccessControlException(String s, Permission p)
From source file:net.sourceforge.safr.jaas.permission.PermissionManagerImpl.java
public void checkPermission(Permission permission) { Subject current = Subject.getSubject(AccessController.getContext()); if (!implies(permission, current) && activated) { throw new AccessControlException("access denied", permission); }/* w ww . j a v a2 s . c o m*/ }
From source file:com.jpeterson.littles3.bo.Acp.java
/** * Determines whether the access request indicated by the specified * permission should be allowed or denied, based on the Access Control * Policy. This method quietly returns if the access request is permitted, * or throws a suitable <code>AccessControlException</code> otherwise. * //from w ww.ja v a 2 s . co m * @param permission * the request permission * @throws AccessControlException * if the specified permission is not permitted. */ public void checkPermission(Permission permission) throws AccessControlException { if (permissions.implies(permission)) { // permission granted return; } throw new AccessControlException("Access Control Policy does not grant this permission", permission); }