Package org.jboss.security

Examples of org.jboss.security.AuthorizationManager.doesUserHaveRole()


    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.doesUserHaveRole(principal, rolePrincipals);
   }

   /** Return the set of domain roles the current active Subject 'Roles' group
      found in the subject Principals set.

View Full Code Here


         throw new SecurityException("AuthorizationManager is null for domain=" + securityDomain);
      boolean hasRole = AccessController.doPrivileged(new PrivilegedAction<Boolean>()
      {
         public Boolean run()
         {
             return authorizationManager.doesUserHaveRole(principal, rolePrincipals);
         }});

      if (trace)
      {
         log.trace("user " + user + (hasRole ? " is " : " is NOT ") + "authorized");
View Full Code Here

    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.doesUserHaveRole(principal, rolePrincipals);
   }

   /** Return the set of domain roles the current active Subject 'Roles' group
      found in the subject Principals set.

View Full Code Here

    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.doesUserHaveRole(principal, rolePrincipals);
   }

   /** Return the set of domain roles the current active Subject 'Roles' group
      found in the subject Principals set.

View Full Code Here

    */
   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
   {
      AuthorizationManager am = SecurityUtil.getAuthorizationManager(securityDomain,
            SecurityConstants.JAAS_CONTEXT_ROOT);
      return am.doesUserHaveRole(principal, rolePrincipals);
   }

   /** Return the set of domain roles the current active Subject 'Roles' group
      found in the subject Principals set.

View Full Code Here

         if (callerRunAs == null)
         {
            AuthorizationManager am = (AuthorizationManager)policyRegistration;
           
            // Now actually check if the current caller has one of the required method roles
            if (am.doesUserHaveRole(ejbPrincipal, methodRoles) == false)
            {
               if(this.ejbMethod == null)
                  throw new IllegalStateException("ejbMethod is null");
              
               Set<Principal> userRoles = am.getUserRoles(ejbPrincipal);
View Full Code Here

      HashSet<Principal> set = new HashSet<Principal>();
      set.add(new SimplePrincipal(roleName));

      boolean allowed = false;
      if (callerRunAs == null)
         allowed = am.doesUserHaveRole(ejbPrincipal, set);
      else
      {
         if(callerRunAs instanceof RunAsIdentity)
         {
            RunAsIdentity callerRunAsIdentity = (RunAsIdentity) callerRunAs;
View Full Code Here

         if (callerRunAsIdentity == null)
         {
            AuthorizationManager am = (AuthorizationManager)policyRegistration;
           
            // Now actually check if the current caller has one of the required method roles
            if (am.doesUserHaveRole(ejbPrincipal, methodRoles) == false)
            {
               Set userRoles = am.getUserRoles(ejbPrincipal);
               String method = this.ejbMethod.getName();
               String msg = "Insufficient method permissions, principal=" + ejbPrincipal
                  + ", ejbName=" + this.ejbName
View Full Code Here

      HashSet set = new HashSet();
      set.add(new SimplePrincipal(roleName));

      boolean allowed = false;
      if (callerRunAsIdentity == null)
         allowed = am.doesUserHaveRole(ejbPrincipal, set);
      else
         allowed = this.callerRunAsIdentity.doesUserHaveRole(set);
     
      return allowed ? AuthorizationContext.PERMIT : AuthorizationContext.DENY;
   }
View Full Code Here

/*     */
/*     */   public boolean doesUserHaveRole(Principal principal, Set<Principal> rolePrincipals)
/*     */   {
/* 451 */     AuthorizationManager am = SecurityUtil.getAuthorizationManager(this.securityDomain, "java:/jaas");
/*     */
/* 453 */     return am.doesUserHaveRole(principal, rolePrincipals);
/*     */   }
/*     */
/*     */   public Set<Principal> getUserRoles(Principal principal)
/*     */   {
/* 466 */     AuthorizationManager am = SecurityUtil.getAuthorizationManager(this.securityDomain, "java:/jaas");
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.