mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 23:13:10 +00:00
[DS-3463] Fix IP authentication for anonymous users
Added group membership check based on context even if no eperson is found. Affects file downloads in (at least) xmlui.
This commit is contained in:
@@ -185,6 +185,15 @@ public class GroupServiceImpl extends DSpaceObjectServiceImpl<Group> implements
|
||||
//lookup eperson in normal groups and subgroups
|
||||
return epersonInGroup(context, groupName, currentUser);
|
||||
} else {
|
||||
// Check also for anonymous users if IP authentication used
|
||||
List<Group> specialGroups = context.getSpecialGroups();
|
||||
if(CollectionUtils.isNotEmpty(specialGroups)) {
|
||||
for(Group specialGroup : specialGroups){
|
||||
if (StringUtils.equals(specialGroup.getName(), groupName)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user