/** * @see AuthorizationModuleDelegate#authorize(Resource) */ public int authorize(Resource resource, Subject callerSubject, RoleGroup role) { if(resource instanceof EJBResource == false) throw new IllegalArgumentException("resource is not an EJBResource"); EJBResource ejbResource = (EJBResource) resource; //Get the context map Map<String,Object> map = resource.getMap(); if(map == null) throw new IllegalStateException("Map from the Resource is null"); this.policyRegistration = (PolicyRegistration) map.get(ResourceKeys.POLICY_REGISTRATION); this.ejbCS = ejbResource.getCodeSource(); this.ejbMethod = ejbResource.getEjbMethod(); this.ejbName = ejbResource.getEjbName(); this.methodInterface = ejbResource.getEjbMethodInterface(); //isCallerInRole checks this.roleName = (String)map.get(ResourceKeys.ROLENAME); this.roleRefCheck = (Boolean)map.get(ResourceKeys.ROLEREF_PERM_CHECK); if(this.roleRefCheck == Boolean.TRUE) return checkRoleRef(callerSubject, role); else return process(callerSubject, role); }
this.ejbMethod = ejbResource.getEjbMethod(); this.ejbName = ejbResource.getEjbName(); this.methodInterface = ejbResource.getEjbMethodInterface(); RunAs runAs = ejbResource.getCallerRunAsIdentity(); if (runAs instanceof RunAsIdentity)
this.ejbName = ejbResource.getEjbName(); this.ejbPrincipal = ejbResource.getPrincipal(); this.methodInterface = ejbResource.getEjbMethodInterface(); this.methodRoles = ejbResource.getEjbMethodRoles(); this.securityRoleReferences = ejbResource.getSecurityRoleReferences();
this.ejbName = ejbResource.getEjbName(); this.ejbPrincipal = ejbResource.getPrincipal(); this.methodInterface = ejbResource.getEjbMethodInterface(); this.methodRoles = ejbResource.getEjbMethodRoles(); this.securityRoleReferences = ejbResource.getSecurityRoleReferences();