mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 03:53:07 +00:00
Merge pull request #1319 from KevinVdV/DS-2996-fix-hiearchical-community-retrieval
[DS-2996] Fix retrieval of hierarchical of communities from a collection
This commit is contained in:
@@ -628,7 +628,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
|
||||
@Override
|
||||
public void canEdit(Context context, Collection collection, boolean useInheritance) throws SQLException, AuthorizeException {
|
||||
List<Community> parents = collection.getCommunities();
|
||||
List<Community> parents = communityService.getAllParents(context, collection);
|
||||
for (Community parent : parents) {
|
||||
if (authorizeService.authorizeActionBoolean(context, parent,
|
||||
Constants.WRITE, useInheritance)) {
|
||||
@@ -803,7 +803,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
List<Community> communities = collection.getCommunities();
|
||||
if (CollectionUtils.isNotEmpty(communities))
|
||||
{
|
||||
community = communities.iterator().next();
|
||||
community = communities.get(0);
|
||||
}
|
||||
|
||||
switch (action)
|
||||
@@ -836,7 +836,7 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
public DSpaceObject getParentObject(Context context, Collection collection) throws SQLException {
|
||||
List<Community> communities = collection.getCommunities();
|
||||
if(CollectionUtils.isNotEmpty(communities)){
|
||||
return communities.iterator().next();
|
||||
return communities.get(0);
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user