Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.GroupPrincipal


     * @throws Exception
     */
    public void testRemoveNonExistantUserPrincipal() throws Exception
    {
        String localUid = Integer.toString(rand.nextInt()).toString();
        GroupPrincipal localPrin = new GroupPrincipalImpl(localUid);
        grHandler.removeGroupPrincipal(localPrin);
        List groups = grHandler.getGroupPrincipals("");
        assertEquals(1,groups.size());
    }
View Full Code Here


        crHandler.setPassword(uid, "", password);
    }
   
    public static void seedGroupData(String gpUid) throws Exception
    {
        GroupPrincipal gp = new GroupPrincipalImpl(gpUid);
        grHandler.setGroupPrincipal(gp);
    }
View Full Code Here

        userHandler.removeUserPrincipal(up);
    }
   
    public static void removeGroupData(String gpUid) throws Exception
    {
        GroupPrincipal gp = new GroupPrincipalImpl(gpUid);
        grHandler.removeGroupPrincipal(gp);
    }
View Full Code Here

     */
    public void testGetGroupPrincipal() throws Exception
    {
        String fullPath = (new GroupPrincipalImpl(gpUid1)).getFullPath();
        //GroupPrincipal groupPrincipal = grHandler.getGroupPrincipal(fullPath);
        GroupPrincipal groupPrincipal = grHandler.getGroupPrincipal(gpUid1);
        assertNotNull("Group was not found.", groupPrincipal);
        assertEquals(gpUid1,groupPrincipal.getName());
        assertEquals(fullPath,groupPrincipal.getFullPath());
    }
View Full Code Here

    /**
     * @throws Exception
     */
    public void testGetNonExistingGroupPrincipal() throws Exception
    {
        GroupPrincipal group = grHandler.getGroupPrincipal(gpUid1 + "FAKE");
        assertNull(group);
    }
View Full Code Here

    /**
     * @throws Exception
     */
    public void testRemoveExistantUserPrincipal() throws Exception
    {
        GroupPrincipal gp = new GroupPrincipalImpl(gpUid1);
        grHandler.removeGroupPrincipal(gp);
        GroupPrincipal groupPrincipal = grHandler.getGroupPrincipal(gp.getFullPath());
        assertNull("Group was found and should have been removed.", groupPrincipal);
        List groups = grHandler.getGroupPrincipals("");
        assertEquals(0,groups.size());       
    }
View Full Code Here

     * @throws Exception
     */
    public void testRemoveNonExistantUserPrincipal() throws Exception
    {
        String localUid = Integer.toString(rand.nextInt()).toString();
        GroupPrincipal localPrin = new GroupPrincipalImpl(localUid);
        grHandler.removeGroupPrincipal(localPrin);
        List groups = grHandler.getGroupPrincipals("");
        assertEquals(1,groups.size());
    }
View Full Code Here

        if (groupExists(groupFullPathName))
        {
            throw new SecurityException(SecurityException.GROUP_ALREADY_EXISTS + " " + groupFullPathName);
        }

        GroupPrincipal groupPrincipal = new GroupPrincipalImpl(groupFullPathName);
        String fullPath = groupPrincipal.getFullPath();
        // Add the preferences.
        Preferences preferences = Preferences.userRoot().node(fullPath);
        if (log.isDebugEnabled())
        {
            log.debug("Added group preferences node: " + fullPath);
View Full Code Here

    /**
     * @see org.apache.jetspeed.security.spi.GroupSecurityHandler#getGroupPrincipal(java.lang.String)
     */
    public Principal getGroupPrincipal(String groupFullPathName)
    {
        GroupPrincipal groupPrincipal = null;
        InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(GroupPrincipalImpl
                .getFullPathFromPrincipalName(groupFullPathName));
        if (null != internalGroup)
        {
            groupPrincipal = new GroupPrincipalImpl(GroupPrincipalImpl.getPrincipalNameFromFullPath(internalGroup
View Full Code Here

     * @throws SecurityException
     */
    private void verifyUserAndGroupExist(String username, String groupFullPathName) throws SecurityException
    {
        UserPrincipal user = getUser(username);
        GroupPrincipal group = getGroup(groupFullPathName);
        if ((null == user) && (null == group))
        {
            throw new SecurityException(SecurityException.USER_DOES_NOT_EXIST);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.GroupPrincipal

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.