mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
added implementation that allows to see withdrawn items to anonynous groups
This commit is contained in:
@@ -8,8 +8,10 @@
|
||||
package org.dspace.app.rest.converter;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -73,6 +75,9 @@ public class ItemConverter
|
||||
List<MetadataValue> fullList = itemService.getMetadata(obj, Item.ANY, Item.ANY, Item.ANY, Item.ANY, true);
|
||||
List<MetadataValue> returnList = new LinkedList<>();
|
||||
try {
|
||||
if (obj.isWithdrawn() && (Objects.isNull(context) || Objects.isNull(context.getCurrentUser()))) {
|
||||
return new MetadataValueList(new ArrayList<MetadataValue>());
|
||||
}
|
||||
if (context != null && authorizeService.isAdmin(context)) {
|
||||
return new MetadataValueList(fullList);
|
||||
}
|
||||
|
@@ -89,8 +89,10 @@ public class AuthorizeServicePermissionEvaluatorPlugin extends RestObjectPermiss
|
||||
// If the item is still inprogress we can process here only the READ permission.
|
||||
// Other actions need to be evaluated against the wrapper object (workspace or workflow item)
|
||||
if (dSpaceObject instanceof Item) {
|
||||
if (!DSpaceRestPermission.READ.equals(restPermission)
|
||||
&& !((Item) dSpaceObject).isArchived() && !((Item) dSpaceObject).isWithdrawn()) {
|
||||
if (((Item) dSpaceObject).isWithdrawn()) {
|
||||
return true;
|
||||
}
|
||||
if (!DSpaceRestPermission.READ.equals(restPermission) && !((Item) dSpaceObject).isArchived()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user