public Object run() throws AuthorizationException { int result = invokeAuthorize(resource); if(result == PERMIT) invokeCommit(); if(result == DENY) { invokeAbort(); throw new AuthorizationException("Denied"); } return null; } });
public Object run() throws AuthorizationException { int result = invokeAuthorize(resource, modules, controlFlags); if (result == PERMIT) invokeCommit( modules, controlFlags ); if (result == DENY) { invokeAbort( modules, controlFlags ); throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage()); } return null; } });
private void invokeCommit() throws AuthorizationException { int length = modules.size(); for(int i = 0; i < length; i++) { AuthorizationModule module = (AuthorizationModule)modules.get(i); boolean bool = module.commit(); if(!bool) throw new AuthorizationException("commit on modules failed:"+module.getClass()); } modules.clear(); }
private void invokeTeardown() throws AuthorizationException { int length = modules.size(); for (int i = 0; i < length; i++) { ACLProvider module = modules.get(i); boolean bool = module.tearDown(); if (!bool) throw new AuthorizationException("TearDown on module failed:" + module.getClass()); } modules.clear(); }
private void invokeAbort() throws AuthorizationException { int length = modules.size(); for(int i = 0; i < length; i++) { AuthorizationModule module = (AuthorizationModule)modules.get(i); boolean bool = module.abort(); if(!bool) throw new AuthorizationException("abort on modules failed:"+module.getClass()); } modules.clear(); }
private <T> Set<T> invokeACL(Class<T> clazz, Resource resource, Identity identity) throws AuthorizationException { Set<T> entitlements = new HashSet<T>(); int length = modules.size(); for (int i = 0; i < length; i++) { ACLProvider module = modules.get(i); try { Set<T> er = module.getEntitlements(clazz, resource, identity); if (er == null) throw new AuthorizationException("module " + module.getClass().getName() + " generated null entitlements."); entitlements.addAll(er); } catch (Exception ae) { throw new AuthorizationException(ae.getMessage()); } } return entitlements; }
private void invokeCommit( List<AuthorizationModule> modules, List<ControlFlag> controlFlags ) throws AuthorizationException { int length = modules.size(); for (int i = 0; i < length; i++) { AuthorizationModule module = modules.get(i); boolean bool = module.commit(); if (!bool) throw new AuthorizationException(PicketBoxMessages.MESSAGES.moduleCommitFailedMessage()); } }
private void invokeAbort( List<AuthorizationModule> modules, List<ControlFlag> controlFlags ) throws AuthorizationException { int length = modules.size(); for (int i = 0; i < length; i++) { AuthorizationModule module = modules.get(i); boolean bool = module.abort(); if (!bool) throw new AuthorizationException(PicketBoxMessages.MESSAGES.moduleAbortFailedMessage()); } }
moduleException = new AuthorizationException(ae.getMessage()); log.trace("REQUISITE failed for " + module); if(moduleException == null) moduleException = new AuthorizationException("Authorization failed"); else throw moduleException; throw new AuthorizationException("Authorization Failed:"+ msg); if(overallDecision == DENY && encounteredOptionalError) throw new AuthorizationException("Authorization Failed:" + msg); if(overallDecision == DENY) throw new AuthorizationException("Authorization Failed:Denied."); return PERMIT;
throw new AuthorizationException(ae.getMessage());
throw new AuthorizationException("Unable to process permission of type " + permission.getClass());
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)); }
moduleException = new AuthorizationException(ae.getMessage()); moduleException = new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage()); else throw moduleException; throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage() + msg); if (overallDecision == DENY && encounteredOptionalError) throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage() + msg); if (overallDecision == DENY) throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage()); return PERMIT;
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)); }
throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLForResourceMessage( resource != null ? resource.toString() : null)); throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLWithNoStrategyMessage());
throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLForResourceMessage( resource != null ? resource.toString() : null)); throw new AuthorizationException(PicketBoxMessages.MESSAGES.unableToLocateACLWithNoStrategyMessage());
throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage());
throw new AuthorizationException(PicketBoxMessages.MESSAGES.authorizationFailedMessage());