mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 05:23:14 +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();
|
EPerson currentUser = context.getCurrentUser();
|
||||||
|
|
||||||
//First check the special groups
|
//First check the special groups
|
||||||
boolean found = false;
|
|
||||||
List<Group> specialGroups = context.getSpecialGroups();
|
List<Group> specialGroups = context.getSpecialGroups();
|
||||||
if(CollectionUtils.isNotEmpty(specialGroups)) {
|
if(CollectionUtils.isNotEmpty(specialGroups)) {
|
||||||
Iterator<Group> it = specialGroups.iterator();
|
for (Group specialGroup : specialGroups)
|
||||||
while (it.hasNext() && !found) {
|
{
|
||||||
Group next = it.next();
|
//Check if the current special group is the one we are looking for OR retrieve all groups & make a check here.
|
||||||
found = StringUtils.equals(next.getName(), groupName);
|
if(StringUtils.equals(specialGroup.getName(), groupName) || allMemberGroups(context, currentUser).contains(findByName(context, groupName)))
|
||||||
}
|
{
|
||||||
}
|
|
||||||
|
|
||||||
if(found) {
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//lookup eperson in normal groups and subgroups
|
//lookup eperson in normal groups and subgroups
|
||||||
return epersonInGroup(context, groupName, currentUser);
|
return epersonInGroup(context, groupName, currentUser);
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user