Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
oharsta committed Jul 15, 2024
1 parent 5b46930 commit 1b2b4c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 3 additions & 3 deletions client/src/pages/RoleForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ export const RoleForm = () => {
if (user.superUser) {
setProviders(providersToOptions(res[newRole ? 0 : 1]));
} else if (user.institutionAdmin) {
setProviders(providersToOptions(distinctValues(user.applications
.concat(user.userRoles.map(userRole => userRole.role.applicationMaps)
.flat()), "id")));
setProviders(providersToOptions(distinctValues(user.applications.concat(
user.userRoles.map(userRole => userRole.role.applicationMaps).flat()
), "id")));
} else {
setProviders(providersToOptions(distinctValues(user.userRoles
.map(userRole => userRole.role.applicationMaps).flat(), "id")));
Expand Down
8 changes: 3 additions & 5 deletions server/src/main/java/access/manage/Manage.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ default Map<String, Object> transformProvider(Map<String, Object> provider) {
Map metaDataFields = (Map) data.get("metaDataFields");
//Can't use Map.of as values can be null
Map application = new HashMap<>();
//Due to the different API's we are using, the result sometimes contains an "_id" and sometimes an "manageId"
//Due to the different API's we are using, the result sometimes contains an "_id" and sometimes an "id"
Object id = provider.get("id");
if (id != null) {
application.put("id", id);
Expand Down Expand Up @@ -138,10 +138,8 @@ default Map<String, Object> enrichInstitutionAdmin(String organizationGUID) {
Map<String, Object> claims = new HashMap<>();
claims.put(INSTITUTION_ADMIN, true);
claims.put(ORGANIZATION_GUID, organizationGUID);
List<Map<String, Object>> applications = providersByInstitutionalGUID(organizationGUID);
claims.put(APPLICATIONS, applications);
Optional<Map<String, Object>> identityProvider = identityProviderByInstitutionalGUID(organizationGUID);
claims.put(INSTITUTION, identityProvider.orElse(null));
claims.put(APPLICATIONS, providersByInstitutionalGUID(organizationGUID));
claims.put(INSTITUTION, identityProviderByInstitutionalGUID(organizationGUID).orElse(null));
return claims;
}

Expand Down

0 comments on commit 1b2b4c0

Please sign in to comment.