[DS-3185] Special group doesn't grant the right to submit

This commit is contained in:
KevinVdV
2016-05-23 12:37:23 +02:00
parent b10fb8d255
commit 324f9a31da

View File

@@ -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);
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;
}
}
}
if(found) {
return true;
} else {
//lookup eperson in normal groups and subgroups
return epersonInGroup(context, groupName, currentUser);
}
//lookup eperson in normal groups and subgroups
return epersonInGroup(context, groupName, currentUser);
} else {
return false;
}