Examples of RolePrincipalImpl


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

                    InternalRolePrincipal internalRole = (InternalRolePrincipal) internalRolesIter.next();
                    Preferences preferences = Preferences.userRoot().node(internalRole.getFullPath());
                    String[] fullPaths = roleHierarchyResolver.resolve(preferences);
                    for (int i = 0; i < fullPaths.length; i++)
                    {
                        Principal rolePrincipal = new RolePrincipalImpl(RolePrincipalImpl
                                .getPrincipalNameFromFullPath(fullPaths[i]));
                        if (!rolePrincipals.contains(rolePrincipal))
                        {
                            rolePrincipals.add(rolePrincipal);
                        }
View Full Code Here

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

                {
                    Iterator internalRolesIter = internalRoles.iterator();
                    while (internalRolesIter.hasNext())
                    {
                        InternalRolePrincipal internalRole = (InternalRolePrincipal) internalRolesIter.next();
                        Principal rolePrincipal = new RolePrincipalImpl(UserPrincipalImpl
                                .getPrincipalNameFromFullPath(internalRole.getFullPath()));
                        if (!rolePrincipals.contains(rolePrincipal))
                        {
                            rolePrincipals.add(rolePrincipal);
                        }
View Full Code Here

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

        final RequestContext rc =
            new JetspeedRequestContext(request, response, config, null);
       
        Set principals = new HashSet();
        principals.add(new UserPrincipalImpl("admin"));
        principals.add(new RolePrincipalImpl("admin"));
        Subject subject = new Subject(true, principals, new HashSet(), new HashSet());
       
        JSSubject.doAsPrivileged(subject, new PrivilegedAction()
                {
                    public Object run()
View Full Code Here

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

        gp1 = new GroupPrincipalImpl(gpUid1);
        gp2 = new GroupPrincipalImpl(gpUid2);
        LdapDataHelper.seedGroupData(gpUid1);
        LdapDataHelper.seedGroupData(gpUid2);
       
        ro1 = new RolePrincipalImpl(roleUid1);
        ro2 = new RolePrincipalImpl(roleUid2);       
        LdapDataHelper.seedRoleData(roleUid1);
        LdapDataHelper.seedRoleData(roleUid2);
               
        LdapDataHelper.seedUserData(uid1, password);
        LdapDataHelper.seedUserData(uid2, password);
View Full Code Here

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

    public void testGetUserPrincipalsInRole() throws Exception
    {
        secHandler.setUserPrincipalInRole(uid1, ro1.getName());
        secHandler.setUserPrincipalInRole(uid2, ro1.getName());

        String fullPathName = new RolePrincipalImpl(roleUid1).getName();
        logger.debug("Role full path name from testGetUserPrincipalsInRole()[" + fullPathName + "]");
        Set userPrincipals = secHandler.getUserPrincipalsInRole(fullPathName);
        assertTrue(userPrincipals.contains(new UserPrincipalImpl(uid1)));
        assertTrue(userPrincipals.contains(new UserPrincipalImpl(uid2)));
        assertEquals("The user should have been in two roles.", 2, userPrincipals.size());
View Full Code Here

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

        secHandler.setRolePrincipalInGroup(gpUid1, ro1.getName());
        secHandler.setRolePrincipalInGroup(gpUid1, ro2.getName());
        secHandler.setRolePrincipalInGroup(gpUid2, ro1.getName());
       

        String fullPathName = new RolePrincipalImpl(roleUid1).getName();
        logger.debug("Role full path name from testGetUserPrincipalsInRole()[" + fullPathName + "]");
        assertEquals("The group should have 2 roles.", 2, secHandler.getRolePrincipalsInGroup(gpUid1).size());
        assertEquals("The group should have 1 role.", 1, secHandler.getRolePrincipalsInGroup(gpUid2).size());
    }
View Full Code Here

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

        secHandler.setRolePrincipalInGroup(gpUid1, ro2.getName());
        secHandler.setRolePrincipalInGroup(gpUid2, ro1.getName());
        secHandler.setUserPrincipalInGroup(uid1,gpUid1);
       

        String fullPathName = new RolePrincipalImpl(roleUid1).getName();
        logger.debug("Role full path name from testGetUserPrincipalsInRole()[" + fullPathName + "]");
        assertEquals("The group should have 2 roles.", 2, secHandler.getRolePrincipalsInGroup(gpUid1).size());
        assertEquals("The group should have 1 role.", 1, secHandler.getRolePrincipalsInGroup(gpUid2).size());
    }    
View Full Code Here

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

    {
        secHandler.setRolePrincipalInGroup(gpUid1, ro1.getName());
        secHandler.setRolePrincipalInGroup(gpUid2, ro1.getName());
        secHandler.setUserPrincipalInRole(uid1, ro1.getName());
        secHandler.setUserPrincipalInRole(uid1, ro2.getName());
        String fullPathName = new RolePrincipalImpl(gpUid1).getName();
        logger.debug("Role full path name from testGetUserPrincipalsInRole()[" + fullPathName + "]");
        assertEquals("The group should have contained 1 role.", 1, secHandler.getRolePrincipalsInGroup(gpUid1)
                .size());
        assertEquals("The group should have contained 1 role.", 1, secHandler.getRolePrincipalsInGroup(gpUid1)
                .size());
View Full Code Here

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

     * @param principalUid The principal uid.
     * @return A group principal object.
     */
    protected Principal makePrincipal(String principalUid)
    {
        return new RolePrincipalImpl(principalUid);
    }
View Full Code Here

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

        InternalRolePrincipal internalRole = commonQueries
                .getInternalRolePrincipal(RolePrincipalImpl
                        .getFullPathFromPrincipalName(roleFullPathName));
        if (null != internalRole)
        {
            rolePrincipal = new RolePrincipalImpl(RolePrincipalImpl
                    .getPrincipalNameFromFullPath(internalRole.getFullPath()));
        }
        return rolePrincipal;
    }
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.