[DS-3179] Collection admin, edit item no authorization to remove file in JSPUI: Additional fixes to fix the unit tests

This commit is contained in:
KevinVdV
2016-05-18 16:41:35 +02:00
parent b2260c48e9
commit 5ebaf76eea
2 changed files with 8 additions and 7 deletions

View File

@@ -395,15 +395,16 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
// Check authorisation
authorizeService.authorizeAction(context, community, Constants.REMOVE);
community.removeCollection(collection);
ArrayList<String> removedIdentifiers = collectionService.getIdentifiers(context, collection);
String removedHandle = collection.getHandle();
UUID removedId = collection.getID();
collection.removeCommunity(community);
if(CollectionUtils.isEmpty(collection.getCommunities())){
if(collection.getCommunities().size() == 1)
{
collectionService.delete(context, collection);
}else{
community.removeCollection(collection);
collection.removeCommunity(community);
}
log.info(LogManager.getHeader(context, "remove_collection",