Examples of createUser()


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

        m.put("", usersPath + "/" + p.getName());
        m.put(usersPath + "/some/intermediate/path", usersPath + "/some/intermediate/path/" + p.getName());

        for (String intermediatePath : m.keySet()) {
            try {
                u = (UserImpl) umgr.createUser(p.getName(), buildPassword(p), p, intermediatePath);
                save(otherSession);

                String expPath = m.get(intermediatePath);
                assertEquals(expPath, u.getNode().getPath());
            } finally {
View Full Code Here

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

        UserImpl u = null;

        String invalidIntermediatePath = ((UserImpl) umgr.getAuthorizable(otherUID)).getNode().getPath();
        try {
            Principal p = getTestPrincipal();
            u = (UserImpl) umgr.createUser(p.getName(), buildPassword(p), p, invalidIntermediatePath);
            save(otherSession);

            fail("An attempt to create a user below an existing user must fail.");
        } catch (RepositoryException e) {
            // success
View Full Code Here

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

        // modify impersonation of new user
        User u = null;
        try {
            Principal p = getTestPrincipal();
            u = umgr.createUser(p.getName(), buildPassword(p));
            save(otherSession);

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

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

        }

        Principal cp = getTestPrincipal();
        User childU = null;
        try {
            childU = umgr.createUser(cp.getName(), buildPassword(cp));
            save(otherSession);

            Group gr = getGroupAdminGroup(umgr);
            try {
                assertFalse("A UserAdmin must not be allowed to modify group " +
View Full Code Here

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

        UserManager umgr = getUserManager(otherSession);
        UserImpl u = null;
        // create a new user -> must succeed.
        try {
            Principal p = getTestPrincipal();
            u = (UserImpl) umgr.createUser(p.getName(), buildPassword(p));
            save(otherSession);

            Authorizable az = userMgr.getAuthorizable(u.getID());
            assertNotNull(az);
            assertEquals(u.getID(), az.getID());
View Full Code Here

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

        UserManager umgr = getUserManager(uSession);
        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));
            save(uSession);
            fail("Group administrator should not be allowed to create a new user.");
        } catch (AccessDeniedException e) {
            // success
        } finally {
View Full Code Here

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

            // ... must not be present in the alternate-workspace
            UserManager umgr = ((JackrabbitSession) s).getUserManager();
            assertNull(umgr.getAuthorizable("testUser"));
            assertFalse(s.nodeExists(userPath));

            User u2 = umgr.createUser("testUser", "testUser");
            s.save();
            assertTrue(s.nodeExists(userPath));

            Value value = superuser.getValueFactory().createValue("anyValue");
            u.setProperty(propertyName1, value);
View Full Code Here

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

        String uid = "testUser";
        UserManager umgr = ((JackrabbitSession) superuser).getUserManager();
        umgr.autoSave(false);
        try {
            // other users created in the default workspace...
            umgr.createUser(uid, uid);
            // the new user must be able to login to the repo
            s = getHelper().getRepository().login(new SimpleCredentials(uid, uid.toCharArray()));

            fail("Non-saved user node -> must not be able to login.");
View Full Code Here

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

        Session s = getHelper().getSuperuserSession(altWsp);
        User u = null;
        try {
            // other users created in the default workspace...
            u = uMgr.createUser("testUser", "testUser");
            superuser.save();

            String userPath = null;
            if (u.getPrincipal() instanceof ItemBasedPrincipal) {
                userPath = ((ItemBasedPrincipal) u.getPrincipal()).getPath();
View Full Code Here

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

        Session s = getHelper().getSuperuserSession(altWsp);
        User u = null;
        try {
            // other users created in the default workspace...
            u = uMgr.createUser("testUser", "testUser");
            superuser.save();

            String userPath = null;
            if (u.getPrincipal() instanceof ItemBasedPrincipal) {
                userPath = ((ItemBasedPrincipal) u.getPrincipal()).getPath();
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.