DS-2086 fix. Corrects the logic to deleting Communities & Collections such that hierarchical deletion test now succeeds. Also corrects minor permissions error in a different unit test.

This commit is contained in:
Tim Donohue
2014-08-15 13:48:03 -05:00
parent 56fda36375
commit 0aa39100a9
2 changed files with 145 additions and 101 deletions

View File

@@ -1027,15 +1027,15 @@ public class CommunityTest extends AbstractDSpaceObjectTest
{
new NonStrictExpectations(AuthorizeManager.class)
{{
// Allow current Community ADD perms
// Allow Community ADD perms (in order to add a new subcommunity to parent)
AuthorizeManager.authorizeAction((Context) any, (Community) any,
Constants.ADD); result = null;
// Allow *parent* Community ADD perms
AuthorizeManager.authorizeActionBoolean((Context) any, (Community) any,
Constants.ADD); result = true;
// Allow current Community REMOVE perms
Constants.ADD, true); result = null;
// Allow Community REMOVE perms (needed to unmap/remove subcommunity)
AuthorizeManager.authorizeAction((Context) any, (Community) any,
Constants.REMOVE); result = null;
Constants.REMOVE, true); result = null;
// Allow Community DELETE perms (needed to actually delete subcommunity)
AuthorizeManager.authorizeAction((Context) any, (Community) any,
Constants.DELETE, true); result = null;
}};
// Turn off authorization temporarily to create a new top-level community