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

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


            try {
                UserManager uMgr = session.getUserManager();
                if (uMgr instanceof UserPerWorkspaceUserManager) {
                    // make sure the user managers autosave flag can be changed to false.
                    if (uMgr.isAutoSave()) {
                        uMgr.autoSave(false);
                        resetAutoSave = true;
                        log.debug("Changed autosave behavior of UserManager to 'false'.");
                    }
                    userManager = (UserPerWorkspaceUserManager) uMgr;
                    initialized = true;
View Full Code Here


    public void testTransientUserCannotLogin() throws RepositoryException, UnsupportedRepositoryOperationException {
        Session s = null;
        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()));
View Full Code Here

            Authorizable a = ((JackrabbitSession) superuser).getUserManager().getAuthorizable(uid);
            if (a != null) {
                a.remove();
                superuser.save();
            }
            umgr.autoSave(true);
        }
    }
}
View Full Code Here

        sImpl = (SessionImpl) superuser;

        UserManager umgr = sImpl.getUserManager();
        if (umgr.isAutoSave()) {
            try {
                umgr.autoSave(false);
            } catch (RepositoryException e) {
                // user manager cannot have the autosave behavior changed
                // -> test not executable
                throw new NotExecutableException("Expected user manager that can have its autosave behavior changed to false.");
            }
View Full Code Here

            SessionImpl.class, String.class}, (SessionImpl) superuser, "admin");
        assertNotNull(um);
        assertTrue(um instanceof UserManagerImpl);
        assertTrue(um.isAutoSave());
        try {
            um.autoSave(false);
            fail("must not be allowed");
        } catch (RepositoryException e) {
            // success
        }
View Full Code Here

        assertNotNull(um);
        assertTrue(um instanceof UserPerWorkspaceUserManager);
        // but: configured class creates a umgr that requires session.save
        assertTrue(um.isAutoSave());
        // changing autosave behavior must succeed.
        um.autoSave(false);
    }

    public void testInvalidConfig() {
        List<InputSource> invalid = new ArrayList();
        invalid.add(new InputSource(new StringReader(INVALID_CONFIG_1)));
View Full Code Here

        sImpl = (SessionImpl) superuser;

        UserManager umgr = sImpl.getUserManager();
        if (umgr.isAutoSave()) {
            try {
                umgr.autoSave(false);
            } catch (RepositoryException e) {
                // user manager cannot have the autosave behavior changed
                // -> test not executable
                throw new NotExecutableException("Expected user manager that can have its autosave behavior changed to false.");
            }
View Full Code Here

            try {
                UserManager uMgr = session.getUserManager();
                if (uMgr instanceof UserPerWorkspaceUserManager) {
                    // make sure the user managers autosave flag can be changed to false.
                    if (uMgr.isAutoSave()) {
                        uMgr.autoSave(false);
                        resetAutoSave = true;
                        log.debug("Changed autosave behavior of UserManager to 'false'.");
                    }
                    userManager = (UserPerWorkspaceUserManager) uMgr;
                    initialized = true;
View Full Code Here

        try {
            UserManager uMgr = session.getUserManager();
            if (uMgr instanceof UserPerWorkspaceUserManager) {
                // make sure the user managers autosave flag can be changed to false.
                if (uMgr.isAutoSave()) {
                    uMgr.autoSave(false);
                    resetAutoSave = true;
                    log.debug("Changed autosave behavior of UserManager to 'false'.");
                }
                userManager = (UserPerWorkspaceUserManager) uMgr;
                initialized = true;
View Full Code Here

        try {
            UserManager uMgr = session.getUserManager();
            if (uMgr instanceof UserPerWorkspaceUserManager) {
                // make sure the user managers autosave flag can be changed to false.
                if (uMgr.isAutoSave()) {
                    uMgr.autoSave(false);
                    resetAutoSave = true;
                    log.debug("Changed autosave behavior of UserManager to 'false'.");
                }
                userManager = (UserPerWorkspaceUserManager) uMgr;
                initialized = true;
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.