Package org.apache.jackrabbit.api.security.user

Examples of org.apache.jackrabbit.api.security.user.UserManager.createUser()


        Root testRoot = getTestRoot();
        testRoot.refresh();

        UserManager testUserMgr = getUserConfiguration().getUserManager(testRoot, NamePathMapper.DEFAULT);
        try {
            User u = testUserMgr.createUser("a", "b");
            testRoot.commit();

            u.changePassword("c");
            testRoot.commit();
View Full Code Here


            ConfigurationParameters params = userConfiguration.getParameters();
            String adminId = params.getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
            if (userManager.getAuthorizable(adminId) == null) {
                boolean omitPw = params.getConfigValue(PARAM_OMIT_ADMIN_PW, false);
                userManager.createUser(adminId, (omitPw) ? null : adminId);
            }
            String anonymousId = Strings.emptyToNull(params.getConfigValue(PARAM_ANONYMOUS_ID, DEFAULT_ANONYMOUS_ID, String.class));
            if (anonymousId != null && userManager.getAuthorizable(anonymousId) == null) {
                userManager.createUser(anonymousId, null);
            }
View Full Code Here

    public void testEditor() throws NotExecutableException, RepositoryException {
        User u = null;
        try {
            UserManager uMgr = getUserManager(superuser);
            u = uMgr.createUser("t", "t");
            Principal p = u.getPrincipal();

            JackrabbitAccessControlManager acMgr = (JackrabbitAccessControlManager) getAccessControlManager(superuser);
            JackrabbitAccessControlPolicy[] acls = acMgr.getApplicablePolicies(p);
View Full Code Here

        User u2 = null;

        try {
            UserManager uMgr = getUserManager(superuser);

            u = uMgr.createUser("t", "t");
            u2 = uMgr.createUser("tt", "tt", new TestPrincipal("tt"), "t/tt");

            Principal p = u.getPrincipal();
            Principal p2 = u2.getPrincipal();
View Full Code Here

        try {
            UserManager uMgr = getUserManager(superuser);

            u = uMgr.createUser("t", "t");
            u2 = uMgr.createUser("tt", "tt", new TestPrincipal("tt"), "t/tt");

            Principal p = u.getPrincipal();
            Principal p2 = u2.getPrincipal();

            if (p instanceof ItemBasedPrincipal && p2 instanceof ItemBasedPrincipal &&
View Full Code Here

            UserManager uMgr = getUserManager(superuser);
            // create the testUser
            String uid = "testUser" + UUID.randomUUID();
            creds = new SimpleCredentials(uid, uid.toCharArray());

            testUser = uMgr.createUser(uid, uid);
        } catch (Exception e) {
            superuser.logout();
            throw e;
        }
    }
View Full Code Here

        UserManager umgr = getUserManager(otherSession);
        UserImpl u = null;
        // create a new user -> must succeed and user must be create below 'other'
        try {
            Principal p = getTestPrincipal();
            u = (UserImpl) umgr.createUser(p.getName(), buildPassword(p));
            assertTrue(Text.isDescendant(otherPath, u.getNode().getPath()));
        } finally {
            if (u != null) {
                u.remove();
            }
View Full Code Here

        UserImpl u = null;
        // create a new user with intermediate-path
        // -> must succeed and user must be create below 'other'
        try {
            Principal p = getTestPrincipal();
            u = (UserImpl) umgr.createUser(p.getName(), buildPassword(p), p, "/some/intermediate/path");
            assertTrue(Text.isDescendant(otherPath, u.getNode().getPath()));
            assertTrue(Text.isDescendant(otherPath + "/some/intermediate/path", u.getNode().getPath()));
        } finally {
            if (u != null) {
                u.remove();
View Full Code Here

        User u = null;
        // create a new user -> must succeed and user must be create below 'other'
        try {
            Principal p = getTestPrincipal();
            u = umgr.createUser(p.getName(), buildPassword(p));

            Impersonation impers = u.getImpersonation();
            assertFalse(impers.allows(buildSubject(otherP)));
            assertTrue(impers.grantImpersonation(otherP));
            assertTrue(impers.allows(buildSubject(otherP)));
View Full Code Here

    public void testModifyGroupForChildUser() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        Principal cp = getTestPrincipal();
        User childU = null;
        try {
            childU = umgr.createUser(cp.getName(), buildPassword(cp));
            Group gr = getGroupAdminGroup(umgr);
            try {
                assertFalse(gr.addMember(childU));
            } catch (RepositoryException e) {
                // success
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.