@Override public Set<Principal> getUserRoles(Principal principal) { return context.getAuthorizationManager().getUserRoles(principal); }
@Override public Set<Principal> getUserRoles(Principal principal) { return context.getAuthorizationManager().getUserRoles(principal); }
@Override public Set<Principal> getUserRoles(Principal principal) { return context.getAuthorizationManager().getUserRoles(principal); }
/** 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. */ @SuppressWarnings("deprecation") public Set<Principal> getUserRoles(Principal principal) { AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain, SecurityConstants.JAAS_CONTEXT_ROOT); return am.getUserRoles(principal); }
/** 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. */ @SuppressWarnings("deprecation") public Set<Principal> getUserRoles(Principal principal) { if(this.authorizationManager == null) { this.authorizationManager = SecurityUtil.getAuthorizationManager(securityDomain, SecurityConstants.JAAS_CONTEXT_ROOT); } if(this.authorizationManager == null) { log.trace("doesUserHaveRole:AuthorizationManager is null"); return null; } return authorizationManager.getUserRoles(principal); }
Set userRoles = authzManager.getUserRoles(authPrincipal); ArrayList roles = new ArrayList(); if (userRoles != null)
/** * @see org.overlord.commons.auth.util.IRoleGenerator#generateRoles(javax.servlet.http.HttpServletRequest) */ @Override public Set<String> generateRoles(HttpServletRequest request) { try { Principal principal = SecurityContextAssociation.getPrincipal(); Set<Principal> userRoles = SecurityContextAssociation.getSecurityContext() .getAuthorizationManager().getUserRoles(principal); Set<String> roles = new HashSet<String>(); if (userRoles != null) { for (Principal role : userRoles) { roles.add(role.getName()); } } return roles; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @see org.overlord.commons.auth.util.SAMLAssertionFactory#createSAMLAssertion(java.lang.String, java.lang.String, int) */ @Override public String createSAMLAssertion(String issuerName, String forService, int timeValidInMillis) { try { Principal principal = SecurityContextAssociation.getPrincipal(); Set<Principal> userRoles = SecurityContextAssociation.getSecurityContext() .getAuthorizationManager().getUserRoles(principal); Set<String> roles = new HashSet<String>(); if (userRoles != null) { for (Principal role : userRoles) { roles.add(role.getName()); } } return SAMLBearerTokenUtil.createSAMLAssertion(principal, roles, issuerName, forService, timeValidInMillis); } catch (Exception e) { throw new RuntimeException(e); } }
/** 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) { if(this.authorizationManager == null) { this.authorizationManager = SecurityUtil.getAuthorizationManager(securityDomain, SecurityConstants.JAAS_CONTEXT_ROOT); } if(this.authorizationManager == null) { PicketBoxLogger.LOGGER.debugNullAuthorizationManager(securityDomain); return null; } return authorizationManager.getUserRoles(principal); }