/** Return the set of domain roles the current active Subject 'Roles' group found in the subject Principals set. @param principal - ignored. The current authenticated Subject determines the active user and assigned user roles. @return The Set<Principal> for the application domain roles that the principal has been assigned. */ public Set<Principal> getUserRoles(Principal principal) { RoleGroup userRoles = getCurrentRoles(principal); return this.getRolesAsSet(userRoles); }
/** Return the set of domain roles the current active Subject 'Roles' group found in the subject Principals set. @param principal - ignored. The current authenticated Subject determines the active user and assigned user roles. @return The Set<Principal> for the application domain roles that the principal has been assigned. */ public Set<Principal> getUserRoles(Principal principal) { RoleGroup userRoles = getCurrentRoles(principal); return this.getRolesAsSet(userRoles); }
/** Does the current Subject have a role(a Principal) that equates to one of the role names. @see #doesUserHaveRole(Principal, Set) @param principal - ignored. The current authenticated Subject determines the active user and assigned user roles. @param role - the application domain role that the principal is to be validated against. @return true if the active principal has the role, false otherwise. */ public boolean doesUserHaveRole(Principal principal, Principal role) { boolean hasRole = false; RoleGroup roles = this.getCurrentRoles(principal); hasRole = doesRoleGroupHaveRole(role, roles); return hasRole; }
/** Does the current Subject have a role(a Principal) that equates to one of the role names. @see #doesUserHaveRole(Principal, Set) @param principal - ignored. The current authenticated Subject determines the active user and assigned user roles. @param role - the application domain role that the principal is to be validated against. @return true if the active principal has the role, false otherwise. */ public boolean doesUserHaveRole(Principal principal, Principal role) { boolean hasRole = false; RoleGroup roles = this.getCurrentRoles(principal); hasRole = doesRoleGroupHaveRole(role, roles); return hasRole; }
RoleGroup roles = this.getCurrentRoles(principal); if( trace ) log.trace("doesUserHaveRole(Set), roles: "+roles);
RoleGroup roles = this.getCurrentRoles(principal); if (PicketBoxLogger.LOGGER.isTraceEnabled())
private RoleGroup getCurrentRoles(Principal principal) { //Check that the caller is authenticated to the current thread Subject subject = SubjectActions.getActiveSubject(); //Deal with the security context SecurityContext sc = SubjectActions.getSecurityContext(); if(sc == null) { sc = new JBossSecurityContext(securityDomain); SubjectActions.setSecurityContext(sc); } return getCurrentRoles(principal,subject,sc); }
private RoleGroup getCurrentRoles(Principal principal) { //Check that the caller is authenticated to the current thread Subject subject = SubjectActions.getActiveSubject(); //Deal with the security context SecurityContext sc = SubjectActions.getSecurityContext(); if(sc == null) { sc = new JBossSecurityContext(securityDomain); SubjectActions.setSecurityContext(sc); } return getCurrentRoles(principal,subject,sc); }
RoleGroup roles = this.getCurrentRoles(callerPrincipal, authenticatedSubject, sc); if(roles == null) roles = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
RoleGroup roles = this.getCurrentRoles(callerPrincipal, authenticatedSubject, sc); if(roles == null) roles = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);