private ACLProvider instantiateModule(String name, Map<String, Object> map) throws PrivilegedActionException { ACLProvider am = null; ClassLoader tcl = SecurityActions.getContextClassLoader(); try { Class<?> clazz = tcl.loadClass(name); am = (ACLProvider) clazz.newInstance(); } catch (Exception e) { log.debug("Error instantiating AuthorizationModule:", e); } if (am == null) throw new IllegalStateException("ACLProvider has not " + "been instantiated"); am.initialize(this.sharedState, map); return am; }
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 <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; }
try decision = module.isAccessGranted(resource, identity, permission) ? PERMIT : DENY; if (trace) log.trace("ACL module " + module.getClass().getName() + (decision == PERMIT ? " granted " : " denied ")