Examples of RoleGroup


Examples of org.jboss.security.identity.RoleGroup

      ejbResource.setSecurityRoleReferences(securityRoleRefs);
      ejbResource.setEnforceEJBRestrictions(enforceEJBRestrictions);
     
      ejbResource.setCallerSubject(callerSubject);
      SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext);
      RoleGroup callerRoles = am.getSubjectRoles(callerSubject, sch);
     
      try
      {
         int check = am.authorize(ejbResource, callerSubject, callerRoles);
         isAuthorized = (check == AuthorizationContext.PERMIT);
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

      webResource.setServletResponse(response);
      webResource.setCallerSubject(callerSubject);
      webResource.setCanonicalRequestURI(canonicalRequestURI);

      SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext);
      RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);

      try
      {
         int permit = authzMgr.authorize(webResource, callerSubject, callerRoles);
         isAuthorized = (permit == AuthorizationContext.PERMIT);
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

      webResource.setPrincipal(principal);
      webResource.setServletName(servletName);
      
      webResource.setCallerSubject(callerSubject);
      SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext);
      RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);
     
      try
      {
         int permit = authzMgr.authorize(webResource, callerSubject, callerRoles);
         hasTheRole = (permit == AuthorizationContext.PERMIT);
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

      webResource.setServletRequest(request);
      webResource.setServletResponse(response);
     
      webResource.setCallerSubject(callerSubject);
      SecurityContextCallbackHandler sch = new SecurityContextCallbackHandler(this.securityContext);
      RoleGroup callerRoles = authzMgr.getSubjectRoles(callerSubject, sch);
     
      try
      {
         int permit = authzMgr.authorize(webResource, callerSubject, callerRoles);
         hasPerm = (permit == AuthorizationContext.PERMIT);
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

         else
         {
            if(callerRunAs instanceof RunAsIdentity)
            {
               RunAsIdentity callerRunAsIdentity = (RunAsIdentity) callerRunAs;
               RoleGroup srg = new SimpleRoleGroup(callerRunAsIdentity.getRunAsRoles());
              
               // Check that the run-as role is in the set of method roles
               if(srg.containsAtleastOneRole(methodRoles) == false)
               {
                  String method = this.ejbMethod.getName();
                  String msg = "Insufficient method permissions, principal=" + ejbPrincipal
                  + ", ejbName=" + this.ejbName
                  + ", method=" + method + ", interface=" + this.methodInterface
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

         RoleGroup mappedObject)
   {
      Set<String> roleset = (Set<String>)principalRolesMap.get(principal.getName());
      if(roleset != null)
      {
         RoleGroup newRoles = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
        
         if(roleset != null)
         {
            for(String r:roleset)
            {
               newRoles.addRole(new SimpleRole(r));           
            }
         }
        
         mappedObject.clearRoles();
         mappedObject.getRoles().addAll(newRoles.getRoles());
      }
      return mappedObject;
   }
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

         }
      }
      else
      {
         //Dealing with another roleGroup
         RoleGroup anotherRG = (RoleGroup) anotherRole;
         List<Role> anotherRoles = anotherRG.getRoles();
         for (Role r : anotherRoles)
         {
            //if any of the roles are not there, no point checking further
            if (!this.containsAll(r))
               return false;
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

   private Set<Principal> getPrincipalSetFromRole(Role role)
   {
      Set<Principal> principalsSet = new HashSet<Principal>();
      if(role instanceof RoleGroup)
      {
         RoleGroup rg = (RoleGroup) role;
         List<Role> rolesList = rg.getRoles();
         for(Role r: rolesList)
         {
           principalsSet.add(new SimplePrincipal(r.getRoleName()));     
         }
      }
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

    @see Subject#getPrincipals()
    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      boolean hasRole = false;
      RoleGroup roles = this.getCurrentRoles(principal);
      if( trace )
         log.trace("doesUserHaveRole(Set), roles: "+roles);
      if(roles != null)
      {
         Iterator<Principal> iter = rolePrincipals.iterator();
View Full Code Here

Examples of org.jboss.security.identity.RoleGroup

    @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;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.