Skip to content

Commit

Permalink
Adjusted remaining endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Blaettlinger <[email protected]>
  • Loading branch information
andreas-blaettlinger committed Jul 2, 2024
1 parent 272b4d2 commit 6875a1b
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public final List<ClientRole> listCompositeClientScopeRoleMappings(@PathParam("i
this.auth.clients().requireView(clientScope);
return toSortedClientRoles(
addSubClientRoles(clientScope.getScopeMappingsStream())
.filter(auth.roles()::canMapClientScope));
);
}

@GET
Expand Down Expand Up @@ -90,7 +90,7 @@ public final List<ClientRole> listCompositeClientsRoleMappings(@PathParam("id")
auth.clients().requireView(client);
return toSortedClientRoles(
addSubClientRoles(client.getScopeMappingsStream())
.filter(auth.roles()::canMapRole));
);
}

@GET
Expand Down Expand Up @@ -120,7 +120,7 @@ public final List<ClientRole> listCompositeGroupsRoleMappings(@PathParam("id") S
auth.groups().requireView(group);
return toSortedClientRoles(
addSubClientRoles(addParents(group).flatMap(GroupModel::getRoleMappingsStream))
.filter(auth.roles()::canMapRole));
);
}

@GET
Expand Down Expand Up @@ -179,9 +179,7 @@ public final List<ClientRole> listCompositeRealmRoleMappings() {
auth.roles().requireList(realm);
final RoleModel defaultRole = this.realm.getDefaultRole();
//this definitely does not return what the descriptions says
return toSortedClientRoles(
addSubClientRoles(Stream.of(defaultRole))
.filter(auth.roles()::canMapRole));
return toSortedClientRoles(addSubClientRoles(Stream.of(defaultRole)));
}

private Stream<RoleModel> addSubClientRoles(Stream<RoleModel> roles) {
Expand Down

0 comments on commit 6875a1b

Please sign in to comment.