public boolean isGranted(ACLPermission permission, Identity identity) { // lookup the entry corresponding to the specified identity. ACLEntry entry = this.entries.get(identity); if (entry != null) { // check the permission associated with the identity. return entry.checkPermission(permission); } return false; }
public boolean isGranted(ACLPermission permission, Identity identity) { if (this.entriesMap == null) this.initEntriesMap(); // lookup the entry corresponding to the specified identity. ACLEntry entry = this.entriesMap.get(identity.getName()); if (entry != null) { // check the permission associated with the identity. return entry.checkPermission(permission); } return false; }
public boolean isGranted(ACLPermission permission, Identity identity) { if (this.entriesMap == null) this.initEntriesMap(); // lookup the entry corresponding to the specified identity. ACLEntry entry = this.entriesMap.get(identity.getName()); if (entry != null) { // check the permission associated with the identity. return entry.checkPermission(permission); } return false; }
public boolean isAccessGranted(Resource resource, Identity identity, ACLPermission permission) throws AuthorizationException { ACL acl = this.retrieveACL(resource); if (acl != null) { ACLEntry entry = acl.getEntry(identity); if (entry != null) { // check the permission associated with the identity. return entry.checkPermission(permission); } // no entry for identity = deny access return false; } else throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLForResourceMessage( resource != null ? resource.toString() : null)); }
public boolean isAccessGranted(Resource resource, Identity identity, ACLPermission permission) throws AuthorizationException { ACL acl = this.retrieveACL(resource); if (acl != null) { ACLEntry entry = acl.getEntry(identity); if (entry != null) { // check the permission associated with the identity. return entry.checkPermission(permission); } // no entry for identity = deny access return false; } else throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLForResourceMessage( resource != null ? resource.toString() : null)); }
if (entry != null && entry.checkPermission(permission)) return true;
if (entry != null && entry.checkPermission(permission)) return true;