Package org.jboss.security.identity

Examples of org.jboss.security.identity.RoleGroup


   {
      Principal ejbPrincipal = new SimplePrincipal("AuthenticatedPrincipal");
      Subject callerSubject = new Subject();
      callerSubject.getPrincipals().add(ejbPrincipal);

      RoleGroup roleGroup = SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"});
     
      //Add good roles to the context
      sc.getUtil().setRoles(roleGroup);
     
      boolean result = eah.authorize("TestEJB",
View Full Code Here


   {
      Principal ejbPrincipal = new SimplePrincipal("AuthenticatedPrincipal");
      Subject callerSubject = new Subject();
      callerSubject.getPrincipals().add(ejbPrincipal);

      RoleGroup roleGroup = SecurityTestUtil.getRoleGroup(new String[]{"villain"});
       
      //Add good roles to the context
      sc.getUtil().setRoles(roleGroup);
     
      boolean result = eah.authorize("TestEJB",
View Full Code Here

   {
      Principal ejbPrincipal = new SimplePrincipal("AuthenticatedPrincipal");
      Subject callerSubject = new Subject();
      callerSubject.getPrincipals().add(ejbPrincipal);

      RoleGroup roleGroup = SecurityTestUtil.getRoleGroup(new String[]{"villain"});
       
      //Add good roles to the context
      sc.getUtil().setRoles(roleGroup);
     
      try
View Full Code Here

      Map<String,Object> contextMap = new HashMap<String,Object>()
     
      HttpServletRequest request = new TestHttpServletRequest(new SimplePrincipal("someprincipal"),
            "/someuri", "GET");
     
      RoleGroup roleGroup = SecurityTestUtil.getRoleGroup(new String[]{"roleA", "roleC"});
     
      //Add good roles to the context
      sc.getUtil().setRoles(roleGroup);
     
      boolean result = wah.checkResourcePermission(contextMap,
View Full Code Here

      Map<String,Object> contextMap = new HashMap<String,Object>()
     
      HttpServletRequest request = new TestHttpServletRequest(new SimplePrincipal("someprincipal"),
            "/someuri", "GET");
     
      RoleGroup roleGroup = SecurityTestUtil.getRoleGroup(new String[]{"Villain"});
     
      //Add good roles to the context
      sc.getUtil().setRoles(roleGroup);
     
      boolean result = wah.checkResourcePermission(contextMap,
View Full Code Here

     
      HashMap<String,Object> map = new HashMap<String,Object>();
      map.put(SecurityConstants.PRINCIPAL_IDENTIFIER, principal);
      map.put(SecurityConstants.DEPLOYMENT_PRINCIPAL_ROLES_MAP, rolesMap);
     
      RoleGroup grp = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      grp.addRole(new SimpleRole("oldRole"));

      MappingContext<RoleGroup> mc = sc.getMappingManager().getMappingContext(RoleGroup.class);
      assertNotNull("Mapping Context is not null", mc);
      mc.performMapping(map, grp);
     
      grp = (RoleGroup) mc.getMappingResult().getMappedObject();
     
      assertFalse("oldRole does not exist", grp.containsRole(new SimpleRole("oldRole")));
      assertTrue("t1 exists?",grp.containsRole(new SimpleRole("t1")));
      assertTrue("t2 exists?",grp.containsRole(new SimpleRole("t2")));
   }
View Full Code Here

      return pmap;
   }
  
   private RoleGroup getGroup(String[] principalArr)
   {
      RoleGroup rg = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      for(String p: principalArr)
      {
         rg.addRole(new SimpleRole(p));
      }
      return rg;
   }
View Full Code Here

                    MappingContext<RoleGroup> mc = mappingManager.getMappingContext(MappingType.ROLE.name());
                    if (mc != null && mc.hasModules()) {
                        SecurityRolesAssociation.setSecurityRoles(principalVersusRolesMap);
                    }
                }
                RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb);
                List<Role> rolesAsList = roles.getRoles();
                List<String> rolesAsStringList = new ArrayList<String>();
                for (Role role : rolesAsList) {
                    rolesAsStringList.add(role.getRoleName());
                }
                if (mappingManager != null) {
View Full Code Here

                    MappingContext<RoleGroup> mc = mappingManager.getMappingContext(MappingType.ROLE.name());
                    if (mc != null && mc.hasModules()) {
                        SecurityRolesAssociation.setSecurityRoles(principalVersusRolesMap);
                    }
                }
                RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb);
                List<Role> rolesAsList = roles.getRoles();
                List<String> rolesAsStringList = new ArrayList<String>();
                for (Role role : rolesAsList) {
                    rolesAsStringList.add(role.getRoleName());
                }
                if (mappingManager != null) {
View Full Code Here

                    MappingContext<RoleGroup> mc = mappingManager.getMappingContext(MappingType.ROLE.name());
                    if (mc != null && mc.hasModules()) {
                        SecurityRolesAssociation.setSecurityRoles(principalVersusRolesMap);
                    }
                }
                RoleGroup roles = authorizationManager.getSubjectRoles(subject, scb);
                List<Role> rolesAsList = roles.getRoles();
                List<String> rolesAsStringList = new ArrayList<String>();
                for (Role role : rolesAsList) {
                    rolesAsStringList.add(role.getRoleName());
                }
                if (mappingManager != null) {
View Full Code Here

TOP

Related Classes of org.jboss.security.identity.RoleGroup

Copyright © 2018 www.massapicom. 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.