Examples of doesUserHaveRole()


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

/* 148 */           this.log.error(msg);
/* 149 */           throw new SecurityException(msg);
/*     */         }
/*     */
/*     */       }
/* 157 */       else if (!callerRunAsIdentity.doesUserHaveRole(roles))
/*     */       {
/* 159 */         String msg = "Insufficient permissions, runAsPrincipal=" + callerRunAsIdentity.getName() + ", requiredRoles=" + roles + ", runAsRoles=" + callerRunAsIdentity.getRunAsRoles();
/*     */
/* 161 */         this.log.error(msg);
/* 162 */         throw new SecurityException(msg);
View Full Code Here

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

         // The caller is using a run-as identity
         else
         {
            // Check that the run-as role is in the set of method roles
            if (callerRunAsIdentity.doesUserHaveRole(roles) == false)
            {
               String msg = "Insufficient permissions, runAsPrincipal=" + callerRunAsIdentity.getName()
               + ", requiredRoles=" + roles + ", runAsRoles=" + callerRunAsIdentity.getRunAsRoles();
               log.error(msg);
               throw new SecurityException(msg);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      SimplePrincipal user = new SimplePrincipal("scott");
      boolean isValid = secMgr.isValid(domain, user, password);
      assertTrue("scott password is echoman", isValid);
      HashSet testRole = new HashSet();
      testRole.add(new SimplePrincipal("Echo"));
      boolean hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has Echo role", hasRole);
      testRole.clear();
      testRole.add(new SimplePrincipal("EchoLocal"));
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has EchoLocal role", hasRole);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      testRole.add(new SimplePrincipal("Echo"));
      boolean hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has Echo role", hasRole);
      testRole.clear();
      testRole.add(new SimplePrincipal("EchoLocal"));
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has EchoLocal role", hasRole);
      testRole.clear();
      testRole.add(new SimplePrincipal("ProjectUser"));
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has ProjectUser role", hasRole);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      testRole.add(new SimplePrincipal("EchoLocal"));
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has EchoLocal role", hasRole);
      testRole.clear();
      testRole.add(new SimplePrincipal("ProjectUser"));
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has ProjectUser role", hasRole);

      isValid = secMgr.isValid(domain, user, "badpass".toCharArray());
      assertTrue("badpass is an invalid password for scott", isValid == false);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      // Test the spec-test-domain security domain
      log.info("+++ testSecurityDomain, domain=spec-test-domain");
      domain = "spec-test-domain";
      isValid = secMgr.isValid(domain, user, password);
      assertTrue("scott password is echoman", isValid);
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has Echo role", hasRole);
      testRole.clear();
      SimplePrincipal echoLocal = new SimplePrincipal("EchoLocal");
      testRole.add(echoLocal);
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has Echo role", hasRole);
      testRole.clear();
      SimplePrincipal echoLocal = new SimplePrincipal("EchoLocal");
      testRole.add(echoLocal);
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has EchoLocal role", hasRole);
      testRole.clear();
      SimplePrincipal projectUser = new SimplePrincipal("ProjectUser");
      testRole.add(projectUser);
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
View Full Code Here

Examples of org.jboss.security.plugins.JaasSecurityManagerServiceMBean.doesUserHaveRole()

      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has EchoLocal role", hasRole);
      testRole.clear();
      SimplePrincipal projectUser = new SimplePrincipal("ProjectUser");
      testRole.add(projectUser);
      hasRole = secMgr.doesUserHaveRole(domain, user, password, testRole);
      assertTrue("scott has ProjectUser role", hasRole);
      Set roles = secMgr.getUserRoles(domain, user, password);
      assertTrue(roles != null);
      assertTrue("roles contains EchoLocal", roles.contains(echoLocal));
      assertTrue("roles contains ProjectUser", roles.contains(projectUser));
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.