mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-09 19:13:18 +00:00
[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:
@@ -668,9 +668,6 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
// Delete bitstream logo
|
||||
setLogo(context, collection, null);
|
||||
|
||||
// Remove all authorization policies
|
||||
authorizeService.removeAllPolicies(context, collection);
|
||||
|
||||
Iterator<WorkspaceItem> workspaceItems = workspaceItemService.findByCollection(context, collection).iterator();
|
||||
while (workspaceItems.hasNext()) {
|
||||
WorkspaceItem workspaceItem = workspaceItems.next();
|
||||
@@ -738,6 +735,9 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
owningCommunity.getCollections().remove(collection);
|
||||
}
|
||||
|
||||
// Remove all authorization policies
|
||||
authorizeService.removeAllPolicies(context, collection);
|
||||
|
||||
collectionDAO.delete(context, collection);
|
||||
}
|
||||
|
||||
|
@@ -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",
|
||||
|
Reference in New Issue
Block a user