Examples of createUser()


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

        try {
            final String userId = xingUser.getId(); // TODO make configurable

            final Session session = getSession();
            final UserManager userManager = getUserManager(session);
            final User user = userManager.createUser(userId, null);

            // TODO disable user on create?
            final ValueFactory valueFactory = session.getValueFactory();
            final Value firstnameValue = valueFactory.createValue(xingUser.getFirstName());
            final Value lastnameValue = valueFactory.createValue(xingUser.getLastName());
View Full Code Here

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

            UserManager userManager =  jackrabbitSession.getUserManager();


            if (userManager.getAuthorizable("testUser") == null) {
                userManager.createUser("testUser", "password");
            }


            final Principal testUserPrincipal = new Principal() {
                public String getName() {
View Full Code Here

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

        final UserManager um = AccessControlUtil.getUserManager(resolver.adaptTo(Session.class));
        for(final String userName : USERS) {
            Authorizable user = um.getAuthorizable(userName);
            if ( user == null ) {
                logger.info("Creating user {}", userName);
                um.createUser(userName, userName);
            }
        }
    }

    private void setupContent(final ResourceResolver resolver) throws PersistenceException {
View Full Code Here

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

                // user already exists!
                throw new RepositoryException(
                    "A principal already exists with the requested name: "
                        + name);
            } else {
                user = userManager.createUser(name, password);
                String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
                    + user.getID();

                Map<String, RequestProperty> reqProperties = collectContent(
                    properties, userPath);
View Full Code Here

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

        UserManager userManager = AccessControlUtil.getUserManager(session);
        Authorizable authorizable = userManager.getAuthorizable(name);
        if (authorizable == null) {
            //principal does not exist yet, so create it
            User user = userManager.createUser(name,
                password,
                new Principal() {
                    public String getName() {
                        return name;
                    }
View Full Code Here

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

            User user = getUser(userId);
            if (user == null) {
                logger.debug("creating a new user with id '{}'", userId);
                final Session session = getSession();
                final UserManager userManager = getUserManager(session);
                user = userManager.createUser(userId, null);
            } else {
                logger.debug("updating an existing user with id '{}'", userId);
            }

            // TODO disable user on create?
View Full Code Here

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

            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

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()

    }

    protected void setupAuthorizables() throws RepositoryException {
        for (JackrabbitSession s : writeSessions) {
            UserManager userManager = s.getUserManager();
            User user = userManager.createUser(userId, userId);

            Group group = userManager.createGroup("group1");
            group.addMember(user);

            Group group2 = userManager.createGroup("group2");
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);
        } finally {
            if (u != null) {
                u.remove();
                save(otherSession);
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.