Package org.apache.jetspeed.security.impl

Examples of org.apache.jetspeed.security.impl.GroupPrincipalImpl


            principal = new UserPrincipalImpl(name);
        }
        else if (fullPath.startsWith(BasePrincipal.PREFS_GROUP_ROOT))
        {
            String name = GroupPrincipalImpl.getPrincipalNameFromFullPath(fullPath);           
            principal = new GroupPrincipalImpl(name);
           
        }
        return principal;
    }
View Full Code Here


       
        // Group or User
        if (fullPath.indexOf("/group/") > -1 )
        {
            name = fullPath.substring(GROUP_PATH.length());
            principal = new GroupPrincipalImpl(name);
        }
        else
        {
            name = fullPath.substring(USER_PATH.length());
            principal = new UserPrincipalImpl(name);
View Full Code Here

       
        // Group or User
        if (fullPath.indexOf("/group/") > -1 )
        {
            name = fullPath.substring(GROUP_PATH.length());
            principal = new GroupPrincipalImpl(name);
        }
        else
        {
            name = fullPath.substring(USER_PATH.length());
            principal = new UserPrincipalImpl(name);
View Full Code Here

        {
            assertTrue("Could not create group. Abort test.", false);
        }

        // Initialization of Group
        Principal principal = new GroupPrincipalImpl(TEST_GROUP);
        Set principals = new HashSet();
        principals.add(principal);
        Subject subject = new Subject(true, principals, new HashSet(), new HashSet());

        // Add SSO Credential for Group
View Full Code Here

            principal = new UserPrincipalImpl(name);
        }
        else if (fullPath.startsWith(BasePrincipal.PREFS_GROUP_ROOT))
        {
            String name = GroupPrincipalImpl.getPrincipalNameFromFullPath(fullPath);           
            principal = new GroupPrincipalImpl(name);
           
        }
        return principal;
    }
View Full Code Here

     * @see org.apache.jetspeed.security.spi.ldap.AbstractLdapTest#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();
        gp1 = new GroupPrincipalImpl(gpUid1);
        gp2 = new GroupPrincipalImpl(gpUid2);
        LdapDataHelper.seedGroupData(gpUid1);
        LdapDataHelper.seedGroupData(gpUid2);
       
        ro1 = new RolePrincipalImpl(roleUid1);
        ro2 = new RolePrincipalImpl(roleUid2);       
View Full Code Here

     */
    public void testGetUserPrincipalsInGroup() throws Exception
    {
        secHandler.setUserPrincipalInGroup(uid1, gp1.getName());
        secHandler.setUserPrincipalInGroup(uid2, gp1.getName());
        String fullPathName = new GroupPrincipalImpl(gpUid1).getName();
        logger.debug("Group full path name from testGetUserPrincipalsInGroup()[" + fullPathName + "]");
        Set userPrincipals = secHandler.getUserPrincipalsInGroup(fullPathName);
        assertTrue(userPrincipals.contains(new UserPrincipalImpl(uid1)));
        assertTrue(userPrincipals.contains(new UserPrincipalImpl(uid2)));
       
View Full Code Here

    {
        // Init test.
        UserPrincipal user = new UserPrincipalImpl("anon");
        RolePrincipal role1 = new RolePrincipalImpl("anonrole1");
        RolePrincipal role2 = new RolePrincipalImpl("anonrole2");
        GroupPrincipal group1 = new GroupPrincipalImpl("anongroup1");
        GroupPrincipal group2 = new GroupPrincipalImpl("anongroup2");
        PortletPermission perm1 = new PortletPermission("anontestportlet", "view");
        PortletPermission perm2 = new PortletPermission("anontestportlet", "view, edit");
        PortletPermission perm3 = new PortletPermission("anontestportlet", "view, edit, secure");
        PortletPermission perm4 = new PortletPermission("anontestportlet", "view, edit, secure, minimized");
        try
        {
            ums.addUser(user.getName(), "password");
            rms.addRole(role1.getName());
            rms.addRole(role2.getName());
            gms.addGroup(group1.getName());
            gms.addGroup(group2.getName());
            pms.addPermission(perm1);
            pms.addPermission(perm2);
            pms.addPermission(perm3);
            pms.addPermission(perm4);
            pms.grantPermission(role1, perm1);
View Full Code Here

                    InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) internalGroupsIter.next();
                    Preferences preferences = Preferences.userRoot().node(internalGroup.getFullPath());
                    String[] fullPaths = groupHierarchyResolver.resolve(preferences);
                    for (int i = 0; i < fullPaths.length; i++)
                    {
                        groupPrincipals.add(new GroupPrincipalImpl(GroupPrincipalImpl
                                .getPrincipalNameFromFullPath(fullPaths[i])));
                    }
                }
            }
        }
View Full Code Here

                {
                    Iterator internalGroupsIter = internalGroups.iterator();
                    while (internalGroupsIter.hasNext())
                    {
                        InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) internalGroupsIter.next();
                        Principal groupPrincipal = new GroupPrincipalImpl(GroupPrincipalImpl
                                .getPrincipalNameFromFullPath(internalGroup.getFullPath()));
                        if (!groupPrincipals.contains(groupPrincipal))
                        {
                            groupPrincipals.add(groupPrincipal);
                        }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.impl.GroupPrincipalImpl

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.