Package java.security.acl

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


               if (defaultAssignedRole != null)
               {
                  Principal role = createIdentity(defaultAssignedRole);
                  if (!group.isMember(role))
                  {
                     group.addMember(role);
                  }
               }
            }
         }
      }
View Full Code Here


            {
               Group rolesGroup = new SimpleGroup("Roles");

               //
               if (additionalRole != null) {
                  rolesGroup.addMember(createIdentity(additionalRole));
               }

               try {
                  User user = getUserModule().findUserByUserName(getUsername());
                  Set roles = getMembershipModule().getRoles(user);
View Full Code Here

                  for (Iterator iterator = roles.iterator(); iterator.hasNext();) {
                     Role role = (Role) iterator.next();
                     String roleName = role.getName();
                     try {
                        Principal p = createIdentity(roleName);
                        rolesGroup.addMember(p);
                     } catch (Exception e) {
                        log.debug("Failed to create principal " + roleName, e);
                     }
                  }
View Full Code Here

            for (int i = 0; i < rolesGroup.length; i++)
            {
               Group group = rolesGroup[i];
               if (group.getName().equals("Roles"))
               {
                  group.addMember(createIdentity(additionalRole));
               }
            }
         }
         catch (Exception e)
         {
View Full Code Here

      Group roles = new SimpleGroup("Roles");
      Group callerPrincipal = new SimpleGroup("CallerPrincipal");
      Group[] groups =
      {roles, callerPrincipal};
      callerPrincipal.addMember(getIdentity());
      return groups;
   }

   protected Subject getServerSubject() throws LoginException
   {
View Full Code Here

        boolean runAsAdded = false;
        final String runAs = serviceSecurity.getRunAs();
        if (runAs != null) {
            runAsPrincipal = new RolePrincipal(runAs);
            if (!rolesGroup.isMember(runAsPrincipal)) {
                rolesGroup.addMember(runAsPrincipal);
                runAsAdded = true;
            }
        }
        Object previous = null;
        try {
View Full Code Here

    try
    {
      Group roles = new SimpleGroup("Roles");
      for (String role : this.identity.getRoles())
      {
        roles.addMember(this.createIdentity(role));
      }

      Group[] groups = { roles };

      return groups;
View Full Code Here

      {
         boolean authenticated = (Boolean)options.get("authenticated");
         if (authenticated)
         {
            Group roles = new SimpleGroup("Roles");
            roles.addMember(new JAASSecurityManager.SimplePrincipal((String)options.get("role")));
            subject.getPrincipals().add(roles);
         }
         return authenticated;

      }
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

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

         Group roleGroup = new JAASGroup(JAASGroup.ROLES);
         for (String role : identity.getRoles())
            roleGroup.addMember(new RolePrincipal(role));

         // group principal
         principals.add(roleGroup);

         // username principal
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.