Skip to content

Commit

Permalink
Applications: Don't require to set auth groups if all users allowed
Browse files Browse the repository at this point in the history
  • Loading branch information
pathob committed May 16, 2024
1 parent fe999b9 commit a5a5f71
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,16 @@ ApplicationDirectoryMapping toApplicationDirectoryMapping(
applicationDirectoryMappingBuilder.setDirectory(findDirectory(applicationBeanDirectoryMapping.getDirectoryName(), directoryManager));

if (applicationBeanDirectoryMapping.getAuthenticationAllowAll() != null) {
applicationDirectoryMappingBuilder.setAllowAllToAuthenticate(applicationBeanDirectoryMapping.getAuthenticationAllowAll());
final boolean authenticationAllowAll = applicationBeanDirectoryMapping.getAuthenticationAllowAll();
applicationDirectoryMappingBuilder.setAllowAllToAuthenticate(authenticationAllowAll);

// don't require to set authentication groups if all users are allowed to authenticate
if (authenticationAllowAll) {
applicationDirectoryMappingBuilder.setAuthorisedGroupNames(Collections.emptySet());
}
}

// even if all users are allowed to authenticate, it does not hurt to set (ignored) authentication groups if they got passed
if (applicationBeanDirectoryMapping.getAuthenticationGroups() != null) {
applicationDirectoryMappingBuilder.setAuthorisedGroupNames(new HashSet<>(applicationBeanDirectoryMapping.getAuthenticationGroups()));
}
Expand Down

0 comments on commit a5a5f71

Please sign in to comment.