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

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


    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        String grId = null;
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            save(otherSession);
            grId = testGroup.getID();

            fail("UserAdmin should not be allowed to create a new Group with intermediate path.");
View Full Code Here


        }

        PrincipalManager pmgr = sImpl.getPrincipalManager();
        if (!pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
            UserManager umgr = sImpl.getUserManager();
            umgr.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME));
            if (!umgr.isAutoSave()) {
                sImpl.save();
            }
            if (pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
                throw new NotExecutableException();
View Full Code Here

    private User[] users;

    @Override
    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]);
        }
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

        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);
        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
            }
View Full Code Here

        Group testGroup = getTestGroup();

        /* create a second group the test user is member of */
        Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
        UserManager umgr = getUserManager(superuser);
        Group group2 = umgr.createGroup(principal);

        try {
            group2.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
View Full Code Here

    protected Group getTestGroup() throws RepositoryException, NotExecutableException {
        if (testGroup == null) {
            // create the testGroup
            Principal principal = new TestPrincipal("testGroup" + UUID.randomUUID());
            UserManager umgr = getUserManager(superuser);
            testGroup = umgr.createGroup(principal);
            testGroup.addMember(testUser);
            if (!umgr.isAutoSave() && superuser.hasPendingChanges()) {
                superuser.save();
            }
        }
View Full Code Here

        }

        PrincipalManager pmgr = sImpl.getPrincipalManager();
        if (!pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
            UserManager umgr = sImpl.getUserManager();
            umgr.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME));
            if (!umgr.isAutoSave()) {
                sImpl.save();
            }
            if (pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
                throw new NotExecutableException();
View Full Code Here

    public void testCreateGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        String grId = null;
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal());
            save(otherSession);
            grId = testGroup.getID();

            fail("UserAdmin should not be allowed to create a new Group.");
View Full Code Here

    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        String grId = null;
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            save(otherSession);
            grId = testGroup.getID();

            fail("UserAdmin should not be allowed to create a new Group with intermediate path.");
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.