Skip to content

Commit

Permalink
Changes from CR
Browse files Browse the repository at this point in the history
  • Loading branch information
ghsolomon committed Apr 2, 2024
1 parent 7c3d3f2 commit dc7365b
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class DefaultRoleService extends BaseRoleService {
* b) String describing lookup error.
*/
protected Map<String, Object> doLoadUsersForDirectoryGroups(Set<String> groups) {
if (!groups) return emptyMap()
if (!ldapService.enabled) {
return groups.collectEntries{[it, 'LdapService not enabled in this application']}
}
Expand All @@ -185,7 +186,7 @@ class DefaultRoleService extends BaseRoleService {
if (group) {
foundGroups << name
} else {
ret[name] = 'No AD group found'
ret[name] = 'Directory Group not found'
}
}

Expand Down Expand Up @@ -272,7 +273,7 @@ class DefaultRoleService extends BaseRoleService {
// Implementation/Framework
//---------------------------
final Map<String, Object> loadUsersForDirectoryGroups(Set<String> directoryGroups) {
!directoryGroups ? emptyMap() : doLoadUsersForDirectoryGroups(directoryGroups)
doLoadUsersForDirectoryGroups(directoryGroups)
}

void refreshRoleAssignments() {
Expand Down Expand Up @@ -300,6 +301,7 @@ class DefaultRoleService extends BaseRoleService {
}
_usersForDirectoryGroups = usersForDirectoryGroups
} catch (Throwable e) {
// Leave existing _usersForDirectoryGroups cache in place, log error, and continue.
logError("Error resolving users for directory groups", e)
}
}
Expand Down

0 comments on commit dc7365b

Please sign in to comment.