Package org.apache.jackrabbit.api

Examples of org.apache.jackrabbit.api.JackrabbitSession.save()


        JackrabbitSession jackrabbitSession = (JackrabbitSession) admin;
        Authorizable vip = jackrabbitSession.getUserManager().getAuthorizable(TEST_USER);
        if (vip != null) {
            vip.remove();
        }
        jackrabbitSession.save();
    }

    @Test
    public void testNotAdminUser() throws Exception {
        JackrabbitSession jackrabbitSession = (JackrabbitSession) admin;
View Full Code Here


                        try {
                            maxtries -= 1;
                            authorizable = s.getUserManager().createUser(name,
                                    "password1", new TestPrincipal(name),
                                    INTERMEDIATE_PATH);
                            s.save();
                        } catch (InvalidItemStateException ex) {
                            lastex = ex;
                            log.println("got " + ex + ", retrying");
                        }
                    }
View Full Code Here

                Group g = userMgr.createGroup(TEST_GROUP_PREFIX + i);
                for (User user : users) {
                    g.addMember(user);
                }
            }
            session.save();
        } finally {
            session.logout();
        }
    }
View Full Code Here

        JackrabbitSession jackrabbitSession = (JackrabbitSession) admin;
        Authorizable vip = jackrabbitSession.getUserManager().getAuthorizable("who");
        if (vip == null) {
            jackrabbitSession.getUserManager().createUser("who", "who");
        }
        jackrabbitSession.save();
        admin.save();
        admin.logout();
        admin = repository.login(new SimpleCredentials("who", "who".toCharArray()));
        assertFalse("\"who\" is not admin/system and doesn't belong to administrators thus shouldn't have admin permissions",
                AdminPermissionChecker.hasAdministrativePermissions(admin));
View Full Code Here

        if (admins == null) {
            admins = jackrabbitSession.getUserManager().createGroup("administrators");
        }
        Group adminsGroup = (Group) admins;
        adminsGroup.addMember(jackrabbitSession.getUserManager().getAuthorizable("anonymous"));
        jackrabbitSession.save();
        admin.save();
        admin.logout();
        admin = repository.login(new SimpleCredentials("anonymous", "anonymous".toCharArray()));
        assertTrue("user \"anonymous\" has been added to administrators group thus should have admin permissions",
                AdminPermissionChecker.hasAdministrativePermissions(admin));
View Full Code Here

        User testUser = (User) session.getUserManager().getAuthorizable(testUserId);
        if (testUser == null) {
            testUser = session.getUserManager().createUser(testUserId, "password");
        }

        session.save();

        testUser.changePassword("newPassword");
        session.save();

        assertEquals("newPassword", newPassword);
View Full Code Here

        }

        session.save();

        testUser.changePassword("newPassword");
        session.save();

        assertEquals("newPassword", newPassword);
    }

    private void basicCrudTest(Repository repository) throws RepositoryException {
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.