Package java.security.acl

Examples of java.security.acl.Group


      String propFileName = (String)options.get("rolesProperties");
      if(propFileName == null)
         throw new IllegalStateException("rolesProperties option needs to be provided");
      // Replace any system property references like ${x}
      propFileName = StringPropertyReplacer.replaceProperties(propFileName);
      Group group = getExistingRolesFromSubject();
      if(propFileName != null)
      {
         Properties props = new Properties();
         try
         {
View Full Code Here


      {
         // Check the caller's roles
         if( trace )
            log.trace("doesUserHaveRole(Set), subject: "+subject);

         Group roles = getSubjectRoles(subject);
         if( trace )
            log.trace("roles="+roles);
         if( roles != null )
         {
            Iterator iter = rolePrincipals.iterator();
View Full Code Here

      {
         // Check the caller's roles
         if( trace )
            log.trace("doesUserHaveRole(Principal), subject: "+subject);

            Group roles = getSubjectRoles(subject);
            if( roles != null )
            {
               hasRole = doesRoleGroupHaveRole(role, roles);
            }
      }
View Full Code Here

      {
         // Copy the caller's roles
         if( trace )
            log.trace("getUserRoles, subject: "+subject);

         Group roles = getSubjectRoles(subject);
         if( roles != null )
         {
            userRoles = new HashSet();
            Enumeration members = roles.members();
            while( members.hasMoreElements() )
            {
               Principal role = (Principal) members.nextElement();
               userRoles.add(role);
            }
View Full Code Here

      */
      Set subjectGroups = subject.getPrincipals(Group.class);
      Iterator iter = subjectGroups.iterator();
      while( iter.hasNext() )
      {
         Group grp = (Group) iter.next();
         String name = grp.getName();
         if( name.equals("CallerPrincipal") )
         {
            Enumeration members = grp.members();
            if( members.hasMoreElements() )
               info.callerPrincipal = (Principal) members.nextElement();
         }
      }
     
View Full Code Here

    */
   private Group getSubjectRoles(Subject theSubject)
   {
       Set subjectGroups = theSubject.getPrincipals(Group.class);
       Iterator iter = subjectGroups.iterator();
       Group roles = null;
       while( iter.hasNext() )
       {
          Group grp = (Group) iter.next();
          String name = grp.getName();
          if( name.equals("Roles") )
             roles = grp;
       }
      return roles;
   }
View Full Code Here

                for (Principal p : principals) {
                    if (!(p instanceof Group) && principal == null) {
                        principal = p;
                    }
                    if (p instanceof Group) {
                        Group g = Group.class.cast(p);
                        if (g.getName().equals(SecurityConstants.CALLER_PRINCIPAL_GROUP) && callerPrincipal == null) {
                            Enumeration<? extends Principal> e = g.members();
                            if (e.hasMoreElements())
                                callerPrincipal = e.nextElement();
                        }
                    }
                }
View Full Code Here

        Set<Principal> principals = subject.getPrincipals();
        for(Principal principal: principals)
        {
            if(principal instanceof Group)
            {
                Group group = (Group) principal;
                if( group.getName().equalsIgnoreCase( ROLES_GROUP_NAME ) )
                {
                    Enumeration<? extends Principal> roles = group.members();
                    while(roles.hasMoreElements())
                    {
                        Principal role = roles.nextElement();
                        if(role.getName().equals(roleName))
                        {
View Full Code Here

    // Javadoc inherited.
    public boolean isOwner(Principal owner) {
        boolean found = owners.contains(owner);
        if (!found) {
            for (Iterator i = groups.iterator(); !found && i.hasNext();) {
                Group group = (Group) i.next();
                if (group.isMember(owner)) {
                    found = true;
                }
            }
        }
View Full Code Here

            Map map, Principal principal, Set permissions) {

        if (map != null) {
            for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
                Map.Entry entry = (Map.Entry) i.next();
                Group group = (Group) entry.getKey();
                if (group.isMember(principal)) {
                    ACLEntry aclEntry = (ACLEntry) entry.getValue();
                    permissions = updatePermissions(permissions, aclEntry);
                }
            }
        }
View Full Code Here

TOP

Related Classes of java.security.acl.Group

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.