mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 03:23:13 +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
|
// Delete bitstream logo
|
||||||
setLogo(context, collection, null);
|
setLogo(context, collection, null);
|
||||||
|
|
||||||
// Remove all authorization policies
|
|
||||||
authorizeService.removeAllPolicies(context, collection);
|
|
||||||
|
|
||||||
Iterator<WorkspaceItem> workspaceItems = workspaceItemService.findByCollection(context, collection).iterator();
|
Iterator<WorkspaceItem> workspaceItems = workspaceItemService.findByCollection(context, collection).iterator();
|
||||||
while (workspaceItems.hasNext()) {
|
while (workspaceItems.hasNext()) {
|
||||||
WorkspaceItem workspaceItem = workspaceItems.next();
|
WorkspaceItem workspaceItem = workspaceItems.next();
|
||||||
@@ -738,6 +735,9 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
|||||||
owningCommunity.getCollections().remove(collection);
|
owningCommunity.getCollections().remove(collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove all authorization policies
|
||||||
|
authorizeService.removeAllPolicies(context, collection);
|
||||||
|
|
||||||
collectionDAO.delete(context, collection);
|
collectionDAO.delete(context, collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -395,15 +395,16 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
|||||||
// Check authorisation
|
// Check authorisation
|
||||||
authorizeService.authorizeAction(context, community, Constants.REMOVE);
|
authorizeService.authorizeAction(context, community, Constants.REMOVE);
|
||||||
|
|
||||||
community.removeCollection(collection);
|
|
||||||
ArrayList<String> removedIdentifiers = collectionService.getIdentifiers(context, collection);
|
ArrayList<String> removedIdentifiers = collectionService.getIdentifiers(context, collection);
|
||||||
String removedHandle = collection.getHandle();
|
String removedHandle = collection.getHandle();
|
||||||
UUID removedId = collection.getID();
|
UUID removedId = collection.getID();
|
||||||
|
|
||||||
|
if(collection.getCommunities().size() == 1)
|
||||||
collection.removeCommunity(community);
|
{
|
||||||
if(CollectionUtils.isEmpty(collection.getCommunities())){
|
|
||||||
collectionService.delete(context, collection);
|
collectionService.delete(context, collection);
|
||||||
|
}else{
|
||||||
|
community.removeCollection(collection);
|
||||||
|
collection.removeCommunity(community);
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info(LogManager.getHeader(context, "remove_collection",
|
log.info(LogManager.getHeader(context, "remove_collection",
|
||||||
|
Reference in New Issue
Block a user