@Override public void performVoid() throws RepositoryException { delegate.remove(); } });
@Override public void remove() throws RepositoryException { try { dlg.remove(); } finally { mgr.autosave(); } }
protected void afterSuite() throws Exception { Node root = admin.getRootNode(); if (root.hasNode(ROOT_NODE_NAME)) { root.getNode(ROOT_NODE_NAME).remove(); } if (userManager != null) { userManager.getAuthorizable(TEST_USER_ID).remove(); } admin.save(); } }
@Override public void after() throws Exception { try { if (toRemove != null) { for (Authorizable a : toRemove) { a.remove(); } } } finally { super.after(); } }
@Override public void after() throws Exception { try { testSession.logout(); Authorizable testUser = userMgr.getAuthorizable(uid); testUser.remove(); adminSession.save(); } finally { super.after(); } }
@Override protected void tearDown() throws Exception { try { Authorizable testGroup = ((JackrabbitSession) superuser).getUserManager().getAuthorizable(testPrincipal); if (testGroup != null) { testGroup.remove(); superuser.save(); } } finally { super.tearDown(); } }
@Override protected void tearDown() throws Exception { try { userMgr.getAuthorizable(uID).remove(); save(superuser); } finally { uSession.logout(); } super.tearDown(); }
@Override protected void tearDown() throws Exception { try { Authorizable testGroup = ((JackrabbitSession) superuser).getUserManager().getAuthorizable(testPrincipal); if (testGroup != null) { testGroup.remove(); superuser.save(); } } finally { super.tearDown(); } }
@Override protected void tearDown() throws Exception { try { Authorizable testGroup = ((JackrabbitSession) superuser).getUserManager().getAuthorizable(testPrincipal); if (testGroup != null) { testGroup.remove(); superuser.save(); } } finally { super.tearDown(); } }
protected void clearAuthorizables() throws RepositoryException { for (JackrabbitSession s : writeSessions) { UserManager userManager = s.getUserManager(); for (String id : ids) { Authorizable a = userManager.getAuthorizable(id); if (a != null) { a.remove(); } } s.save(); } }
@Override public void after() throws Exception { try { root.refresh(); user2.remove(); root.commit(); } finally { super.after(); } }
public void testRemoveOwnAuthorizable() throws RepositoryException, NotExecutableException { Authorizable himself = uMgr.getAuthorizable(uID); try { himself.remove(); save(uSession); fail("A user should not be allowed to remove him/herself."); } catch (AccessDeniedException e) { // success } }
public void testRemoveSelf() throws RepositoryException, NotExecutableException { Authorizable admin = userMgr.getAuthorizable(adminId); if (admin == null) { throw new NotExecutableException(); } try { admin.remove(); fail("The Administrator should not be allowed to remove the own authorizable."); } catch (RepositoryException e) { // success } }
/** * A member of 'usermanagers' must be able to remove another user. * * @throws RepositoryException * @throws NotExecutableException */ public void testRemoveAnotherUser() throws RepositoryException, NotExecutableException { UserManager umgr = getUserManager(otherSession); Authorizable user = umgr.getAuthorizable(uID); user.remove(); save(otherSession); }
public void testRemoveAdmin() { String adminID = superuser.getUserID(); try { Authorizable admin = userMgr.getAuthorizable(adminID); admin.remove(); fail("The admin user cannot be removed."); } catch (RepositoryException e) { // OK superuser cannot be removed. not even by the superuser itself. } }
@Test public void testRemoveUser() throws Exception { createUser(userId); // testSession has user-mgt permission -> removal should succeed. modify("/", PrivilegeConstants.REP_USER_MANAGEMENT, true); UserManager testUserMgr = getUserManager(testSession); Authorizable a = testUserMgr.getAuthorizable(userId); a.remove(); testSession.save(); }
@Test public void testRemoveExternalUser() throws Exception { getUserManager(root).getAuthorizable(USER_ID).remove(); root.commit(); }
@Override public void after() throws Exception { try { Authorizable a = getUserManager(root).getAuthorizable(id); if (a != null) { a.remove(); root.commit(); } } finally { super.after(); } }
public void testRemoveSelf() throws RepositoryException, NotExecutableException { UserManager umgr = getUserManager(uSession); Authorizable himself = umgr.getAuthorizable(uID); try { himself.remove(); save(uSession); fail("A GroupAdministrator should not be allowed to remove the own authorizable."); } catch (AccessDeniedException e) { // success } }
public void testRemoveHimSelf() throws RepositoryException, NotExecutableException { UserManager umgr = getUserManager(otherSession); Authorizable himself = umgr.getAuthorizable(otherUID); try { himself.remove(); save(otherSession); fail("A UserAdministrator should not be allowed to remove himself."); } catch (AccessDeniedException e) { // success } }