mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 18:44:22 +00:00
[DS-562] Community admin or user with WRITE, ADD and ADMIN policy on collection cannot delete that collection due to bug in AuthorizeUtil.authorizeManageTemplateItem(context,collection)
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5703 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -909,16 +909,20 @@ public class Collection extends DSpaceObject
|
||||
|
||||
collectionRow.setColumnNull("template_item_id");
|
||||
DatabaseManager.update(ourContext, collectionRow);
|
||||
|
||||
|
||||
if (template != null)
|
||||
{
|
||||
log.info(LogManager.getHeader(ourContext, "remove_template_item",
|
||||
"collection_id=" + getID() + ",template_item_id="
|
||||
+ template.getID()));
|
||||
|
||||
// temporary turn off auth system, we have already checked the permission on the top of the method
|
||||
// check it again will fail because we have already broken the relation between the collection and the item
|
||||
ourContext.turnOffAuthorisationSystem();
|
||||
template.delete();
|
||||
ourContext.restoreAuthSystemState();
|
||||
template = null;
|
||||
}
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, getID(), "remove_template_item"));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user