Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.UserPrincipal


        }
        catch (SecurityException sex)
        {
        }
       
        UserPrincipal user = new UserPrincipalImpl("anon");

        FolderPermission perm1 = new FolderPermission("/files/test.xml", "edit");
        FolderPermission perm2 = new FolderPermission("/files/subfolder1/*", "view");
        FolderPermission perm3 = new FolderPermission("/files/subfolder2/-", "view");
        try
View Full Code Here


    /**
     * @throws Exception
     */
    public void testRemoveExistantUserPrincipal() throws Exception
    {
        UserPrincipal up = new UserPrincipalImpl(uid1);
        userHandler.removeUserPrincipal(up);
        assertTrue("User was found and should have been removed.", userHandler.getUserPrincipal(uid1) == null);
    }
View Full Code Here

     * @throws Exception
     */
    public void testRemoveNonExistantUserPrincipal() throws Exception
    {
        String localUid = Integer.toString(rand.nextInt()).toString();
        UserPrincipal localPrin = new UserPrincipalImpl(localUid);

        userHandler.removeUserPrincipal(localPrin);
    }
View Full Code Here

    /** The {@link RoleSecurityHandler}. */
    private static RoleSecurityHandler roleHandler;   
   
    public static void seedUserData(String uid, String password) throws Exception
    {
        UserPrincipal up = new UserPrincipalImpl(uid);
        userHandler.addUserPrincipal(up);
        crHandler.setPassword(uid, "", password);
    }
View Full Code Here

        roleHandler.setRolePrincipal(rp);
    }
   
    public static void removeUserData(String uid) throws Exception
    {
        UserPrincipal up = new UserPrincipalImpl(uid);
        userHandler.removeUserPrincipal(up);
    }
View Full Code Here

                        {
                            User user = null;
                            try
                            {
                                user = um.getUser(userName);
                                UserPrincipal userPrincipal = (UserPrincipal)SecurityHelper.getPrincipal(user.getSubject(), UserPrincipal.class);
                                if ( !userPrincipal.isEnabled() )
                                {
                                    request.setSessionAttribute(LoginConstants.ERRORCODE, LoginConstants.ERROR_USER_DISABLED);
                                }
                                else
                                {
View Full Code Here

        // Check if user already exists.
        if (userExists(username)) {
            throw new SecurityException(SecurityException.USER_ALREADY_EXISTS.create(username));
        }

        UserPrincipal userPrincipal = new UserPrincipalImpl(username);
        String fullPath = userPrincipal.getFullPath();
        // Add the preferences.
        Preferences preferences = Preferences.userRoot().node(fullPath);
        if (log.isDebugEnabled())
        {
            log.debug("Added user preferences node: " + fullPath);
View Full Code Here

        { username}, new String[]
        { "username"}, "removeUser(java.lang.String)");

        if (getAnonymousUser().equals(username)) { throw new SecurityException(
                SecurityException.ANONYMOUS_USER_PROTECTED.create(username)); }
        UserPrincipal userPrincipal = new UserPrincipalImpl(username);
        String fullPath = userPrincipal.getFullPath();
        atnProviderProxy.removeUserPrincipal(userPrincipal);
        // Remove preferences
        Preferences preferences = Preferences.userRoot().node(fullPath);
        try
        {
View Full Code Here

        if ( getAnonymousUser().equals(username) )
        {
            throw new SecurityException(SecurityException.ANONYMOUS_USER_PROTECTED);
        }
        UserPrincipal userPrincipal = new UserPrincipalImpl(username);
        String fullPath = userPrincipal.getFullPath();
        atnProviderProxy.removeUserPrincipal(userPrincipal);
        // Remove preferences
        Preferences preferences = Preferences.userRoot().node(fullPath);
        try
        {
View Full Code Here

        }
        catch (SecurityException sex)
        {
        }
       
        UserPrincipal user = new UserPrincipalImpl("anon");

        FolderPermission perm1 = new FolderPermission("/files/test.xml", "edit");
        FolderPermission perm2 = new FolderPermission("/files/subfolder1/*", "view");
        FolderPermission perm3 = new FolderPermission("/files/subfolder2/-", "view");
        try
View Full Code Here

TOP

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

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.