Examples of SimpleRole


Examples of org.jboss.identity.idm.impl.api.model.SimpleRole

      //TODO: add createRoleType switch to the API

      IdentityObjectRelationship rel = getRepository().createRelationship(getInvocationContext(), createIdentityObject(group), createIdentityObject(user), ROLE, roleType.getName(), false);

      //TODO: null id - IdentityObjectRelationship doesn't have id
      return new SimpleRole(new SimpleRoleType(rel.getName()), createUser(rel.getToIdentityObject()), createGroup(rel.getFromIdentityObject()));

   }
View Full Code Here

Examples of org.jboss.identity.idm.impl.api.model.SimpleRole

      for (IdentityObjectRelationship relationship : rels)
      {
         if (roleType.getName().equals(relationship.getName()))
         {
            return new SimpleRole(new SimpleRoleType(relationship.getName()),
               createUser(relationship.getToIdentityObject()),
               createGroup(relationship.getFromIdentityObject()));
         }
      }
View Full Code Here

Examples of org.jboss.identity.idm.impl.api.model.SimpleRole

      {
         if (roleType != null)
         {
            if (roleType.getName().equals(relationship.getName()))
            {
               roles.add(new SimpleRole(new SimpleRoleType(relationship.getName()), createUser(relationship.getToIdentityObject()), createGroup(relationship.getFromIdentityObject())));
            }
         }
         else
         {
            roles.add(new SimpleRole(new SimpleRoleType(relationship.getName()), createUser(relationship.getToIdentityObject()), createGroup(relationship.getFromIdentityObject())));
         }
      }

      return roles;
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

         if (subject != null)
         {
            for(Principal p : subject.getPrincipals())
            {
               // TODO: not really true, but for the moment lets assume that the principal is also the role
               Role myRole = new SimpleRole(p.getName());
               if(methodRoles.containsRole(myRole))
                  return AuthorizationContext.PERMIT;
            }
         }
         if (ejbResource.getCallerRunAsIdentity() != null)
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

               int len = tokens != null ? tokens.length : 0;
               for(int i = 0; i < len; i++)
               {
                  if(this.REPLACE_ROLES)
                     removeMembers.add(r);
                  addMembers.add(new SimpleRole(tokens[i]));
               }
            } 
         }
      }
     
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

      // First check that role is not a NobodyPrincipal
      if (role instanceof NobodyPrincipal)
         return false;
     
      // Check for inclusion in the user's role set
      boolean isMember = userRoles.containsRole(new SimpleRole(role.getName()));
      if (isMember == false)
      {   // Check the AnybodyPrincipal special cases
         isMember = (role instanceof AnybodyPrincipal);
      }
     
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

      if(source == null && toCopy != null)
         source = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
      Enumeration<? extends Principal> en = toCopy.members();
      while(en.hasMoreElements())
      {
         source.addRole(new SimpleRole(en.nextElement().getName()));
      }
      
      return source;
   }
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

         throw new IllegalArgumentException("roleGroup is null");
      SimpleRoleGroup srg = new SimpleRoleGroup(roleGroup.getName());
      Enumeration<? extends Principal> principals = roleGroup.members();
      while(principals.hasMoreElements())
      {
         srg.getRoles().add(new SimpleRole(principals.nextElement().getName()));
      }
      return srg; 
   }
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

        
         if(roleset != null)
         {
            for(String r:roleset)
            {
               newRoles.addRole(new SimpleRole(r));           
            }
         }
        
         mappedObject.clearRoles();
         mappedObject.getRoles().addAll(newRoles.getRoles());
View Full Code Here

Examples of org.jboss.security.identity.plugins.SimpleRole

        if (cachedAccount != null && cachedAccount.getPrincipal() == userPrincipal) {
            // populate the security context using the cached account data.
            jbossSct.getUtil().createSubjectInfo(userPrincipal, ((AccountImpl) cachedAccount).getCredential(), null);
            RoleGroup roleGroup = new SimpleRoleGroup(SecurityConstants.ROLES_IDENTIFIER);
            for (String role : cachedAccount.getRoles())
                roleGroup.addRole(new SimpleRole(role));
            jbossSct.getUtil().setRoles(roleGroup);
            return cachedAccount;
        }

        // SAM handled a different principal or there is no cached account: build a new account.
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.