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; }
/** * <p> * Initializes the entries map of this {@code ACL} instance. * </p> */ private void initEntriesMap() { this.entriesMap = new HashMap<String, ACLEntry>(); for (ACLEntry entry : this.entries) this.entriesMap.put(entry.getIdentityOrRole(), entry); }
public boolean addEntry(ACLEntry entry) { // don't add a null entry or an entry that already exists. if (entry == null || this.entries.get(entry.getIdentity()) != null) return false; this.entries.put(entry.getIdentity(), entry); return true; }
currentPermission = entry.getPermission(); entitlements.add(new EntitlementEntry(resource, currentPermission, identityName));
currentPermission = entry.getPermission(); entitlements.add(new EntitlementEntry(resource, currentPermission, identityName));
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; }
/** * <p> * Initializes the entries map of this {@code ACL} instance. * </p> */ private void initEntriesMap() { this.entriesMap = new HashMap<String, ACLEntry>(); for (ACLEntry entry : this.entries) this.entriesMap.put(entry.getIdentityOrRole(), entry); }
return entry.getPermission();
public boolean removeEntry(ACLEntry entry) { return (this.entries.remove(entry.getIdentity()) != null); }
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 addEntry(ACLEntry entry) { if (this.entriesMap == null) this.initEntriesMap(); // don't add a null entry or an entry that already existSELECT * FROM ACL_ENTRYs. if (entry == null || this.entriesMap.get(entry.getIdentityOrRole()) != null) return false; this.entries.add((ACLEntryImpl) entry); ((ACLEntryImpl) entry).setAcl(this); this.entriesMap.put(entry.getIdentityOrRole(), entry); return true; }
return entry.getPermission();
/** * <p> * Builds an instance of <code>ACLImpl</code> for the specified resource, and initialize * it with the specified entries. * </p> * * @param resource a reference to the <code>Resource</code> associated with * the ACL being constructed. * @param entries a <code>Collection</code> containing the ACL's initial entries. */ public ACLImpl(Resource resource, Collection<ACLEntry> entries) { this.resource = resource; this.entries = new HashMap<Identity, ACLEntry>(); for (ACLEntry entry : entries) this.entries.put(entry.getIdentity(), entry); }
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 removeEntry(ACLEntry entry) { if (this.entriesMap == null) this.initEntriesMap(); this.entriesMap.remove(entry.getIdentityOrRole()); return this.entries.remove(entry); }
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 removeEntry(ACLEntry entry) { if (this.entriesMap == null) this.initEntriesMap(); this.entriesMap.remove(entry.getIdentityOrRole()); return this.entries.remove(entry); }
if (entry != null && entry.checkPermission(permission)) return true;
public boolean addEntry(ACLEntry entry) { if (this.entriesMap == null) this.initEntriesMap(); // don't add a null entry or an entry that already existSELECT * FROM ACL_ENTRYs. if (entry == null || this.entriesMap.get(entry.getIdentityOrRole()) != null) return false; this.entries.add((ACLEntryImpl) entry); ((ACLEntryImpl) entry).setAcl(this); this.entriesMap.put(entry.getIdentityOrRole(), entry); return true; }
if (entry != null && entry.checkPermission(permission)) return true;