mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 10:04:21 +00:00
Merge pull request #1415 from KevinVdV/DS-3185-fix-special-group-rights
[DS-3185] Special group doesn't grant the right to submit
This commit is contained in:
@@ -171,22 +171,19 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
|
||||
EPerson currentUser = context.getCurrentUser();
|
||||
|
||||
//First check the special groups
|
||||
boolean found = false;
|
||||
List<Group> specialGroups = context.getSpecialGroups();
|
||||
if(CollectionUtils.isNotEmpty(specialGroups)) {
|
||||
Iterator<Group> it = specialGroups.iterator();
|
||||
while (it.hasNext() && !found) {
|
||||
Group next = it.next();
|
||||
found = StringUtils.equals(next.getName(), groupName);
|
||||
}
|
||||
}
|
||||
|
||||
if(found) {
|
||||
for (Group specialGroup : specialGroups)
|
||||
{
|
||||
//Check if the current special group is the one we are looking for OR retrieve all groups & make a check here.
|
||||
if(StringUtils.equals(specialGroup.getName(), groupName) || allMemberGroups(context, currentUser).contains(findByName(context, groupName)))
|
||||
{
|
||||
return true;
|
||||
} else {
|
||||
}
|
||||
}
|
||||
}
|
||||
//lookup eperson in normal groups and subgroups
|
||||
return epersonInGroup(context, groupName, currentUser);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user