Package java.security.acl

Examples of java.security.acl.Group.addMember()


   public Group asGroup()
   {
      try
      {
         Group gp = IdentityFactory.createGroup("Roles");
         gp.addMember(IdentityFactory.createPrincipal(role.getRoleName()));
         return gp;
      }
      catch(Exception e)
      {
         throw new RuntimeException(e);
View Full Code Here


         Group newRoles = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
         Iterator iter = roleset.iterator();
         while(iter.hasNext())
         {
            String rolename = (String)iter.next();
            newRoles.addMember(createNewPrincipal(mappedObject,rolename));
         }
         mappedObject = MappingProviderUtil.replacePrincipals(mappedObject, newRoles)
      }
      result.setMappedObject(mappedObject);
   }
View Full Code Here

            try
            {
               Principal p = aslm.createIdentity(name);
               if( trace )
                  log.trace("Assign user to role " + name);
               group.addMember(p);
            }
            catch(Exception e)
            {
               log.debug("Failed to create principal: "+name, e);
            }
View Full Code Here

   private Group getGroupFromRoleSet(Set<Principal> roleset)
   {
      Group gp = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
      for(Principal p: roleset)
      {
         gp.addMember(p);
      }
      return gp;
   }
}
View Full Code Here

      if(a != null)
      {
         Enumeration en = a.members();
         while(en.hasMoreElements())
         {
            newGroup.addMember((Principal)en.nextElement());
         }
      }
      return newGroup;
   }
  
View Full Code Here

         {
            /* A NestableGroup only allows Groups to be added to it so we
            need to add a SimpleGroup to subjectRoles to contain the roles
            */
            SimpleGroup tmp = new SimpleGroup("Roles");
            subjectGroup.addMember(tmp);
            subjectGroup = tmp;
         }
         // Copy the group members to the Subject group
         Enumeration members = group.members();
         while( members.hasMoreElements() )
View Full Code Here

         // Copy the group members to the Subject group
         Enumeration members = group.members();
         while( members.hasMoreElements() )
         {
            Principal role = (Principal) members.nextElement();
            subjectGroup.addMember(role);
         }
      }
      return true;
   }
View Full Code Here

      if(a != null)
      {
         Enumeration en = a.members();
         while(en.hasMoreElements())
         {
            newGroup.addMember((Principal)en.nextElement());
         }
      }
      return newGroup;
   }
  
View Full Code Here

            try
            {
               Principal p = aslm.createIdentity(name);
               if( trace )
                  log.trace("Assign user to role " + name);
               group.addMember(p);
            }
            catch(Exception e)
            {
               log.debug("Failed to create principal: "+name, e);
            }
View Full Code Here

      Set<Principal> principals = subject.getPrincipals();

      Group roleGroup = new SimpleGroup("Roles");
      for (String role : getRoles(username))
      {
         roleGroup.addMember(new SimplePrincipal(role));
      }

      // group principal
      principals.add(roleGroup);
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.