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

Examples of org.apache.jackrabbit.oak.spi.security.user.UserProvider.createUser()


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

        String userID = "thabit";
        Tree user = up.createUser(userID, null);
        root.commit(DefaultConflictHandler.OURS);

        Tree a = up.getAuthorizable(userID, Type.USER);
        assertNotNull(a);
        assertEquals(user.getPath(), a.getPath());
View Full Code Here


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

        Tree user = up.createUser("shams", null);
        Tree a = up.getAuthorizableByPath(user.getPath());
        assertNotNull(a);
        assertEquals(user, a);

        Tree group = up.createGroup("devs", null);
View Full Code Here

    @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));
View Full Code Here

        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";
View Full Code Here

    }

    @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) {
View Full Code Here

    @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.");
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.