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(uSession);
        Group testGroup = null;
        try {
            testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            assertTrue(Text.isDescendant(UserConstants.GROUPS_PATH + "/any/intermediate/path", ((GroupImpl)testGroup).getNode().getPath()));
        } finally {
            if (testGroup != null) {
                testGroup.remove();
            }
View Full Code Here


        Group userAdmin = (Group) auth;
        Group testGroup = null;
        User self = (User) umgr.getAuthorizable(uID);
        try {
            // let groupadmin create a new group
            testGroup = umgr.createGroup(getTestPrincipal(), "/a/b/c/d");

            // editing session adds itself to that group -> must succeed.
            assertTrue(testGroup.addMember(self));

            // editing session adds itself to user-admin group
View Full Code Here

    }
    String roleId = tenantedRoleNameUtils.getPrincipleId( tenant, role );

    UserManager tenantUserMgr = getUserManager( tenant, session );
    // Intermediate path will always be an empty string. The path is already provided while creating a user manager
    tenantUserMgr.createGroup( new PrincipalImpl( roleId ), "" ); //$NON-NLS-1$
    setRoleMembers( session, tenant, role, memberUserNames );
    setRoleDescription( session, tenant, role, description );
    return getRole( session, theTenant, roleName );
  }
View Full Code Here

    }

    public void testCreateGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal());
            fail("UserAdmin should not be allowed to create a new Group.");
            testGroup.remove();
        } catch (RepositoryException e) {
            // success.
        }
View Full Code Here

    }

    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(otherSession);
        try {
            Group testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            fail("UserAdmin should not be allowed to create a new Group.");
            testGroup.remove();
        } catch (RepositoryException e) {
            // success.
        }
View Full Code Here

    public void testCreateGroup() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
        Group testGroup = null;
        try {
            testGroup = umgr.createGroup(getTestPrincipal());
            assertTrue(Text.isDescendant(UserConstants.GROUPS_PATH, ((GroupImpl)testGroup).getNode().getPath()));
        } finally {
            if (testGroup != null) {
                testGroup.remove();
            }
View Full Code Here

    public void testCreateGroupWithIntermediatePath() throws RepositoryException, NotExecutableException {
        UserManager umgr = getUserManager(uSession);
        Group testGroup = null;
        try {
            testGroup = umgr.createGroup(getTestPrincipal(), "/any/intermediate/path");
            assertEquals("Intermediate path must be ignored.",-1, ((GroupImpl)testGroup).getNode().getPath().indexOf("/any/intermediate/path"));
        } finally {
            if (testGroup != null) {
                testGroup.remove();
            }
View Full Code Here

        Group userAdmin = (Group) auth;
        Group testGroup = null;
        User self = (User) umgr.getAuthorizable(uID);
        try {
            // let groupadmin create a new group
            testGroup = umgr.createGroup(getTestPrincipal(), "/a/b/c/d");

            // editing session adds itself to that group -> must succeed.
            assertTrue(testGroup.addMember(self));

            // editing session adds itself to user-admin group
View Full Code Here

    public void testPersisted() throws NotExecutableException, RepositoryException {
        UserManager umgr = getUserManager(uSession);
        Group gr = null;
        try {
            Principal p = getTestPrincipal();
            gr = umgr.createGroup(p);

            Authorizable az = userMgr.getAuthorizable(gr.getID());
            assertNotNull(az);
            assertEquals(gr.getID(), az.getID());
        } finally {
View Full Code Here

        UserManager uMgr = getUserManager(superuser);
        //uMgr.autoSave(true);
        User u = uMgr.createUser("any_principal" + UUID.randomUUID(), "foobar");

        // create group with mixin properties
        GroupImpl gr = (GroupImpl) uMgr.createGroup("any_group" + UUID.randomUUID());
        for (int i=0; i<100; i++) {
            User testUser = uMgr.createUser("any_principal" + UUID.randomUUID(), "foobar");
            gr.addMember(testUser);
        }
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.