Package org.apache.jackrabbit.oak.spi.security.user

Examples of org.apache.jackrabbit.oak.spi.security.user.UserProvider


        assertEquals(group, a);
    }

    @Test
    public void testIsAdminUser() throws Exception {
        UserProvider userProvider = createUserProvider();

        Tree adminTree = userProvider.createUser(defaultConfig.getAdminId(), null);
        userProvider.isAdminUser(adminTree);

        List<Tree> others = new ArrayList<Tree>();
        others.add(userProvider.createUser("laura", null));
        others.add(userProvider.createGroup("administrators", null));

        for (Tree other : others) {
            assertFalse(userProvider.isAdminUser(other));
        }
    }
View Full Code Here


        }
    }

    @Test
    public void testGetAuthorizableId() throws Exception {
        UserProvider up = createUserProvider();

        String userID = "Amanda";
        Tree user = up.createUser(userID, null);
        assertEquals(userID, up.getAuthorizableId(user, Type.USER));
        assertEquals(userID, up.getAuthorizableId(user, Type.AUTHORIZABLE));
        assertNull(up.getAuthorizableId(user, Type.GROUP));

        String groupID = "visitors";
        Tree group = up.createGroup(groupID, null);
        assertEquals(groupID, up.getAuthorizableId(group, Type.GROUP));
        assertEquals(groupID, up.getAuthorizableId(group, Type.AUTHORIZABLE));
        assertNull(up.getAuthorizableId(group, Type.USER));
    }
View Full Code Here

        assertNull(up.getAuthorizableId(group, Type.USER));
    }

    @Test
    public void testRemoveParentTree() throws Exception {
        UserProvider up = createUserProvider();
        Tree u1 = up.createUser("b", "b");
        Tree u2 = up.createUser("bb", "bb");

        Tree folder = root.getTree(Text.getRelativeParent(u1.getPath(), 2));
        folder.remove();
        if (up.getAuthorizable("b") != null) {
            fail("Removing the top authorizable folder must remove all users contained.");
            u1.remove();
        }
        if (up.getAuthorizable("bb") != null) {
            fail("Removing the top authorizable folder must remove all users contained.");
            u2.remove();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.security.user.UserProvider

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.