Examples of doesUserHaveRole()


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

         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

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

      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

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

/*     */
/*     */   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

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

/*     */     {
/* 152 */       if (this.callerRunAs == null)
/*     */       {
/* 154 */         AuthorizationManager am = (AuthorizationManager)this.policyRegistration;
/*     */
/* 157 */         if (!am.doesUserHaveRole(this.ejbPrincipal, this.methodRoles))
/*     */         {
/* 159 */           if (this.ejbMethod == null) {
/* 160 */             throw new IllegalStateException("ejbMethod is null");
/*     */           }
/* 162 */           Set userRoles = am.getUserRoles(this.ejbPrincipal);
View Full Code Here

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

/* 236 */     HashSet set = new HashSet();
/* 237 */     set.add(new SimplePrincipal(this.roleName));
/*     */
/* 239 */     boolean allowed = false;
/* 240 */     if (this.callerRunAs == null) {
/* 241 */       allowed = am.doesUserHaveRole(this.ejbPrincipal, set);
/*     */     }
/* 244 */     else if ((this.callerRunAs instanceof RunAsIdentity))
/*     */     {
/* 246 */       RunAsIdentity callerRunAsIdentity = (RunAsIdentity)this.callerRunAs;
/* 247 */       allowed = callerRunAsIdentity.doesUserHaveRole(set);
View Full Code Here

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

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

         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

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

      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

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

    @see Subject#getPrincipals()
    */
   public boolean doesUserHaveRole(Principal principal, Set rolePrincipals)
   {
      AuthorizationManager am = Util.getAuthorizationManager(securityDomain);
      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

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

            }
            Subject subject = SecurityActions.getAuthenticatedSubject();
           
            Set<Principal> expectedRoles = rolesSet(roles);
            if (!authorizationManager.doesUserHaveRole(null, expectedRoles)) {
                SecurityContext sc = SecurityActions.getSecurityContext();
                StringBuilder builder = new StringBuilder("Authorization Failed:Subject=");
                builder.append(subject).append(":Expected Roles=").append(expectedRoles);
                SecurityContextCallbackHandler scbh = new SecurityContextCallbackHandler(sc);
                builder.append("::Actual Roles=").append(authorizationManager.getSubjectRoles(subject, scbh));
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.