72517: ITs for authorization features for edit item in REST

- Fix for getItemObject() in ItemServiceImpl and CommunityServiceImpl for DELETE actions
This commit is contained in:
Peter Nijs
2020-08-25 17:39:50 +02:00
parent d83f43f017
commit fae212d281
6 changed files with 849 additions and 20 deletions

View File

@@ -1100,19 +1100,7 @@ prevent the generation of resource policy entry values with null dspace_object a
}
break;
case Constants.DELETE:
if (item.getOwningCollection() != null) {
if (AuthorizeConfiguration.canCollectionAdminPerformItemDeletion()) {
adminObject = collection;
} else if (AuthorizeConfiguration.canCommunityAdminPerformItemDeletion()) {
adminObject = community;
}
} else {
if (AuthorizeConfiguration.canCollectionAdminManageTemplateItem()) {
adminObject = collection;
} else if (AuthorizeConfiguration.canCommunityAdminManageCollectionTemplateItem()) {
adminObject = community;
}
}
adminObject = item;
break;
case Constants.WRITE:
// if it is a template item we need to check the