Examples of createUser()


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

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

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

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

        SessionImpl session = (SessionImpl) repository
                .login(new SimpleCredentials("admin", "admin".toCharArray()));
        UserManager userManager = session.getUserManager();
        User user = (User) userManager.getAuthorizable("test");
        if (user == null) {
            user = userManager.createUser("test", "quatloos");
        }
        // set up permissions
        String path = session.getRootNode().getPath();
        AccessControlManager accessControlManager = session
                .getAccessControlManager();
View Full Code Here

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

        try {
            String adminId = getConfig().getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
            UserManager userMgr = getUserManager(root);
            Authorizable admin = userMgr.getAuthorizable(adminId);
            if (admin == null) {
                admin = userMgr.createUser(adminId, adminId);
                root.commit();
            }

            root.getTree(admin.getPath()).remove();
            root.commit();
View Full Code Here

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

        try {
            String adminId = getConfig().getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
            UserManager userMgr = getUserManager(root);
            Authorizable admin = userMgr.getAuthorizable(adminId);
            if (admin == null) {
                admin = userMgr.createUser(adminId, adminId);
                root.commit();
            }

            root.getTree(admin.getPath()).getParent().remove();
            root.commit();
View Full Code Here

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

        try {
            String adminId = getConfig().getConfigValue(PARAM_ADMIN_ID, DEFAULT_ADMIN_ID);
            UserManager userMgr = getUserManager(root);
            Authorizable admin = userMgr.getAuthorizable(adminId);
            if (admin == null) {
                admin = userMgr.createUser(adminId, adminId);
                root.commit();
            }

            root.getTree(admin.getPath()).setProperty(REP_DISABLED, "disabled");
            root.commit();
View Full Code Here

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

                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);
            }
            if (root.hasPendingChanges()) {
                root.commit();
            }
        } catch (RepositoryException e) {
View Full Code Here

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

    public void testAccessControlActionForUser() throws Exception {
        UserManager userMgr = getUserManager(root);
        User u = null;
        try {
            String uid = "actionTestUser";
            u = userMgr.createUser(uid, uid);
            root.commit();

            assertAcAction(u, PrivilegeConstants.JCR_ALL);
        } finally {
            root.refresh();
View Full Code Here

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

    public void testUserLogin() throws Exception {
        UserManager userManager = getUserManager(root);
        ContentSession cs = null;
        User user = null;
        try {
            user = userManager.createUser("test", "pw");
            root.commit();

            cs = login(new SimpleCredentials("test", "pw".toCharArray()));
            AuthInfo authInfo = cs.getAuthInfo();
            assertEquals("test", authInfo.getUserID());
View Full Code Here

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

    public void testSelfImpersonation() throws Exception {
        UserManager userManager = getUserManager(root);
        ContentSession cs = null;
        User user = null;
        try {
            user = userManager.createUser("test", "pw");
            root.commit();

            SimpleCredentials sc = new SimpleCredentials("test", "pw".toCharArray());
            cs = login(sc);
View Full Code Here

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

    public void testInvalidImpersonation() throws Exception {
        UserManager userManager = getUserManager(root);
        ContentSession cs = null;
        User user = null;
        try {
            user = userManager.createUser("test", "pw");
            root.commit();

            SimpleCredentials sc = new SimpleCredentials("test", "pw".toCharArray());
            cs = login(sc);
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.