Skip to content

Commit

Permalink
Fixed defaultRoleService.list() failing if presented with a bad rol…
Browse files Browse the repository at this point in the history
…eMember
  • Loading branch information
jskupsik committed May 20, 2024
1 parent d5be107 commit e468395
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DefaultRoleAdminService extends BaseService {
errorsForGroups = emptyMap()

if (defaultRoleService.directoryGroupsSupported) {
Set<String> groups = roles.collectMany(new HashSet()) { it.directoryGroups }
Set<String> groups = roles.collectMany(new HashSet()) { it?.directoryGroups }
if (groups) {
try {
Map<String, Object> groupsLookup = defaultRoleService.loadUsersForDirectoryGroups(groups, true)
Expand All @@ -56,8 +56,8 @@ class DefaultRoleAdminService extends BaseService {
roles.collect {role ->
def inheritedRoles = getInheritedRoles(role),
effectiveRoles = getEffectiveRoles(role),
effectiveGroups = getEffectiveMembers(role, effectiveRoles) { it.directoryGroups },
effectiveAssignedUsers = getEffectiveMembers(role, effectiveRoles) { it.users },
effectiveGroups = getEffectiveMembers(role, effectiveRoles) { it?.directoryGroups },
effectiveAssignedUsers = getEffectiveMembers(role, effectiveRoles) { it?.users },
effectiveUsers = getEffectiveUsers(effectiveAssignedUsers, effectiveGroups, usersForGroups),
effectiveGroupNames = effectiveGroups*.name.toSet()
[
Expand Down

0 comments on commit e468395

Please sign in to comment.