Package org.glassfish.security.common

Examples of org.glassfish.security.common.Group


      // Build the Subject
      Set<Principal> principals = _subject.getPrincipals();
      principals.add(new PrincipalImpl(user));
      if (groups != null) {
        for (String group: groups) {
          principals.add(new Group(group));
        }
      }
    }
    // Return the impersonated Subject
View Full Code Here


        try {
            SecurityContext secContext = SecurityContext.getCurrent();
            Set ps = secContext.getPrincipalSet(); //before generics
            for (Object principal : ps) {
                if (principal instanceof Group) {
                    Group group = (Group) principal;
                    if (group.getName().equals(AdminConstants.DOMAIN_ADMIN_GROUP_NAME))
                        return true;
                }
            }
            ADMSEC_LOGGER.fine("User is not a member of the special admin group");
            return false;
View Full Code Here

                String nameValue = (String) tokenizer.nextElement();
                if (nameValue != null && nameValue.contains("=")) {
                    int delimiterLocation = nameValue.indexOf("=");
                    String eisGroup = nameValue.substring(0, delimiterLocation);
                    String appserverGroup = nameValue.substring(delimiterLocation + 1);
                    eisASMap.put(new Group(eisGroup), new Group(appserverGroup));
                }
            }
            return eisASMap;
        }
        return null;
View Full Code Here

        for(PrincipalMap map : principalsMap){
            eisASMap.put(new PrincipalImpl(map.getEisPrincipal()), new PrincipalImpl(map.getMappedPrincipal()));
        }

        for(GroupMap map : groupsMap){
            eisASMap.put(new Group(map.getEisGroup()), new Group(map.getMappedGroup()));
        }
        return eisASMap;
    }
View Full Code Here

        try {
            SecurityContext secContext = SecurityContext.getCurrent();
            Set ps = secContext.getPrincipalSet(); //before generics
            for (Object principal : ps) {
                if (principal instanceof Group) {
                    Group group = (Group) principal;
                    if (group.getName().equals(AdminConstants.DOMAIN_ADMIN_GROUP_NAME))
                        return true;
                }
            }
            logger.fine("User is not the member of the special admin group");
            return false;
View Full Code Here

                        rm.assignRole(principals.get(i).getPrincipal(),
                            role, descriptor);
                    }
                    List<String> groups = srm.getGroupNames();
                    for (int i = 0; i < groups.size(); i++) {
                        rm.assignRole(new Group(groups.get(i)),
                            role, descriptor);
                    }
                }
            }               
        } else if (newDescriptor instanceof IdempotentUrlPattern) {
View Full Code Here

                principalSet.add(_userPrincipal);
            }
            java.util.Enumeration groupsList = getGroups(digestCredentials.getUserName());
            while (groupsList.hasMoreElements()) {
                java.lang.String value = (java.lang.String) groupsList.nextElement();
                Group g = factory.getGroupInstance(value, digestCredentials.getRealmName());
                if (!principalSet.contains(g)) {
                    principalSet.add(g);
                }
                // cleaning the slate
            }
View Full Code Here

                                for (String principal : principals) {
                                    wsmf.ADMIN_PRINCIPAL.put(realmName + principal, new PrincipalImpl(principal));
                                }
                            }
                            for (String group : srm.getGroupNames()) {
                                wsmf.ADMIN_GROUP.put(realmName + group, new Group(group));
                            }
                        }
                    }
                    SecurityRoleAssignment[] sras = sunDes.getSecurityRoleAssignments();
                    if(sras != null){
                        for (SecurityRoleAssignment sra : sras) {
                            List<String> principals = sra.getPrincipalNames();
                            if (sra.isExternallyDefined()) {
                                wsmf.ADMIN_GROUP.put(realmName + sra.getRoleName(), new Group(sra.getRoleName()));
                                continue;
                            }
                            for (String principal : principals) {
                                    wsmf.ADMIN_PRINCIPAL.put(realmName + principal, new PrincipalImpl(principal));
                            }
View Full Code Here

                principalSet.add(_userPrincipal);
            }
            java.util.Enumeration groupsList = getGroups(digestCredentials.getUserName());
            while (groupsList.hasMoreElements()) {
                java.lang.String value = (java.lang.String) groupsList.nextElement();
                Group g = factory.getGroupInstance(value, digestCredentials.getRealmName());
                if (!principalSet.contains(g)) {
                    principalSet.add(g);
                }
                // cleaning the slate
            }
View Full Code Here

        return p;
    }
   
    public Group getGroupInstance(String name, String realm){
        WebSecurityManagerFactory fact = getWebSecurityManagerFactory();
        Group g = (Group)fact.getAdminGroup(name, realm);
        if(g == null){
            g = new Group(name);
        }
        return g;
    }
View Full Code Here

TOP

Related Classes of org.glassfish.security.common.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.