mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
minor fix
This commit is contained in:
@@ -66,17 +66,15 @@ public class CanManageMappingsFeature implements AuthorizationFeature {
|
||||
}
|
||||
if (object instanceof ItemRest) {
|
||||
Item item = itemService.find(context, UUID.fromString(((ItemRest) object).getUuid()));
|
||||
Collection parentCollection = item.getCollections().get(0);
|
||||
List<Collection> collections = null;
|
||||
try {
|
||||
collections = collectionService.findCollectionsWithSubmit("", context, null, 0, 2)
|
||||
.stream()
|
||||
.filter(c -> !c.getID().equals(parentCollection.getID()))
|
||||
.collect(Collectors.toList());
|
||||
List<Collection> collections = collectionService.findCollectionsWithSubmit("", context, null, 0, 2)
|
||||
.stream()
|
||||
.filter(c -> !c.getID().equals(item.getOwningCollection().getID()))
|
||||
.collect(Collectors.toList());
|
||||
return CollectionUtils.isNotEmpty(collections);
|
||||
} catch (SearchServiceException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
return CollectionUtils.isNotEmpty(collections);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Component
|
||||
@AuthorizationFeatureDocumentation(name = CanManageRelationshipsFeature.NAME,
|
||||
description = "It can be used to verify if the user has WRITE permission on the Item")
|
||||
description = "It can be used to verify if the user has permissions to manage relationships of the Item")
|
||||
public class CanManageRelationshipsFeature implements AuthorizationFeature {
|
||||
|
||||
public static final String NAME = "canManageRelationships";
|
||||
|
Reference in New Issue
Block a user