@Override protected void setUp() throws Exception { super.setUp(); impl = (UserManagerImpl) userMgr; }
@Override protected void setUp() throws Exception { super.setUp(); }
@Override protected void setUp() throws Exception { super.setUp(); if (!(userMgr instanceof UserManagerImpl)) { throw new NotExecutableException("UserManagerImpl expected -> cannot perform test."); } NameResolver resolver = (SessionImpl) superuser; pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME); }
@Override protected void setUp() throws Exception { super.setUp(); if (superuser instanceof SessionImpl) { NameResolver resolver = (SessionImpl) superuser; protectedUserProps.add(resolver.getJCRName(UserConstants.P_PASSWORD)); protectedUserProps.add(resolver.getJCRName(UserConstants.P_IMPERSONATORS)); protectedUserProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME)); protectedUserProps.add(resolver.getJCRName(UserConstants.P_DISABLED)); protectedGroupProps.add(resolver.getJCRName(UserConstants.P_MEMBERS)); protectedGroupProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME)); } else { throw new NotExecutableException(); } }
@Override protected void setUp() throws Exception { super.setUp(); Principal test = getTestPrincipal(); String pw = buildPassword(test); newUser = userMgr.createUser(test.getName(), pw); save(superuser); impersonation = newUser.getImpersonation(); }
@Override protected void setUp() throws Exception { super.setUp(); if (!(userMgr instanceof UserManagerImpl)) { throw new NotExecutableException(); } UserManagerImpl umgr = (UserManagerImpl) userMgr; // Workaround for testing cache behaviour that relies on observation: // - retrieve session attached to the userManager implementation. // - using superuser will not work if users are stored in a different workspace. Authorizable a = umgr.getAuthorizable(getPrincipalSetFromSession(superuser).iterator().next()); Session s = ((AuthorizableImpl) a).getNode().getSession(); principalProvider = new DefaultPrincipalProvider(s, umgr); principalProvider.init(new Properties()); }
@Override protected void setUp() throws Exception { super.setUp(); if (!(userMgr instanceof UserManagerImpl)) { throw new NotExecutableException(); } adminId = superuser.getUserID(); if (!((UserManagerImpl) userMgr).isAdminId(adminId)) { throw new NotExecutableException(); } }
@Override protected void setUp() throws Exception { super.setUp(); Principal p = getTestPrincipal(); String pw = buildPassword(p); creds = new SimpleCredentials(p.getName(), pw.toCharArray()); User u = userMgr.createUser(p.getName(), pw); save(superuser); uID = u.getID(); uSession = getHelper().getRepository().login(creds); uMgr = getUserManager(uSession); }
protected void setUp() throws Exception { super.setUp(); // create a first user and retrieve the UserManager from the session // created for that new user. Principal p = getTestPrincipal(); String pw = buildPassword(p); UserImpl u = (UserImpl) userMgr.createUser(p.getName(), pw); save(superuser); uID = u.getID(); // create a session for the other user. uSession = getHelper().getRepository().login(new SimpleCredentials(uID, pw.toCharArray())); uMgr = getUserManager(uSession); }
@Override protected void setUp() throws Exception { super.setUp(); RepositoryImpl repo = (RepositoryImpl) superuser.getRepository(); String wspName = repo.getConfig().getSecurityConfig().getSecurityManagerConfig().getWorkspaceName(); s = getHelper().getSuperuserSession(wspName); provider = new UserAccessControlProvider(); provider.init(s, Collections.emptyMap()); }
@Override protected void setUp() throws Exception { super.setUp(); String workspaceName = ((RepositoryImpl) superuser.getRepository()).getConfig().getSecurityConfig().getSecurityManagerConfig().getWorkspaceName(); s = (SessionImpl) ((SessionImpl) superuser).createSession(workspaceName); usersPath = ((UserManagerImpl) userMgr).getUsersPath(); groupsPath = ((UserManagerImpl) userMgr).getGroupsPath(); }
@Override protected void setUp() throws Exception { super.setUp(); // create a first user and retrieve the UserManager from the session // created for that new user. Principal p = getTestPrincipal(); String pw = buildPassword(p); creds = buildCredentials(p.getName(), pw); UserImpl u = (UserImpl) userMgr.createUser(p.getName(), pw); save(superuser); uID = u.getID(); uSession = getHelper().getRepository().login(creds); uMgr = getUserManager(uSession); // create a second user 'below' the first user. p = getTestPrincipal(); pw = buildPassword(p); User u2 = userMgr.createUser(p.getName(), pw); save(superuser); otherUID = u2.getID(); }
@Override protected void setUp() throws Exception { super.setUp(); // create a first user and retrieve the UserManager from the session // created for that new user. Principal p = getTestPrincipal(); UserImpl u = (UserImpl) userMgr.createUser(p.getName(), buildPassword(p)); save(superuser); uID = u.getID(); // create a second user p = getTestPrincipal(); String pw = buildPassword(p); Credentials otherCreds = buildCredentials(p.getName(), pw); User other = userMgr.createUser(p.getName(), pw); save(superuser); otherUID = other.getID(); // make other user a user-administrator: Authorizable ua = userMgr.getAuthorizable(UserConstants.USER_ADMIN_GROUP_NAME); if (ua == null || !ua.isGroup()) { throw new NotExecutableException("Cannot execute test. No user-administrator group found."); } uAdministrators = (Group) ua; uAdministrators.addMember(other); // create a session for the other user. otherSession = getHelper().getRepository().login(otherCreds); }
protected void setUp() throws Exception { super.setUp(); // create a first user Principal p = getTestPrincipal(); UserImpl pUser = (UserImpl) userMgr.createUser(p.getName(), buildPassword(p)); save(superuser); otherUID = pUser.getID(); // create a second user and make it group-admin p = getTestPrincipal(); String pw = buildPassword(p); Credentials creds = buildCredentials(p.getName(), pw); User user = userMgr.createUser(p.getName(), pw); save(superuser); uID = user.getID(); // make other user a group-administrator: Authorizable grAdmin = userMgr.getAuthorizable(UserConstants.GROUP_ADMIN_GROUP_NAME); if (grAdmin == null || !grAdmin.isGroup()) { throw new NotExecutableException("Cannot execute test. No group-administrator group found."); } groupAdmin = (Group) grAdmin; groupAdmin.addMember(user); save(superuser); grID = groupAdmin.getID(); // create a session for the group-admin user. uSession = getHelper().getRepository().login(creds); groupsPath = (userMgr instanceof UserManagerImpl) ? ((UserManagerImpl) userMgr).getGroupsPath() : UserConstants.GROUPS_PATH; }
@Override public void setUp() throws Exception { super.setUp();