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

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


        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

    protected void beforeSuite() throws Exception {
        UserManager userMgr = ((JackrabbitSession) loginWriter()).getUserManager();
        group = userMgr.createGroup(GROUP_PRINCIPAL);
        users = new User[USER_COUNT];
        for (int i = 0; i < users.length; i++) {
            users[i] = userMgr.createUser("user_" + i, "pass");
            group.addMember(users[i]);
        }
    }

    @Override
View Full Code Here

        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

        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

            // ... 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

        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

        // create the testGroup
        UserManager umgr = getUserManager(superuser);

        Principal groupPrincipal = new TestPrincipal("testGroup" + UUID.randomUUID());
        testGroup = umgr.createGroup(groupPrincipal);
        testUser = umgr.createUser("testUser" + UUID.randomUUID(), "pw");
        if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
            superuser.save();
        }
    }
View Full Code Here

    public void testEditor() throws NotExecutableException, RepositoryException {
        UserManager uMgr = getUserManager(superuser);       
        User u = null;
        try {
            u = uMgr.createUser("t", "t");
            if (!uMgr.isAutoSave()) {
                superuser.save();
            }

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

    public void testEditor2() throws NotExecutableException, RepositoryException {
        UserManager uMgr = getUserManager(superuser);
        User u = null;
        User u2 = null;
        try {
            u = uMgr.createUser("t", "t");
            u2 = uMgr.createUser("tt", "tt", new TestPrincipal("tt"), "t/tt");
            if (!uMgr.isAutoSave()) {
                superuser.save();
            }
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.