Skip to content

Commit 4527213

Browse files
committed
Fixes #657
1 parent abccbef commit 4527213

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

client/src/pages/Application.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {AUTHORITIES, isUserAllowed} from "../utils/UserRole";
1111
import {deriveApplicationAttributes} from "../utils/Manage";
1212
import {isEmpty, stopEvent} from "../utils/Utils";
1313
import {Entities} from "../components/Entities";
14-
import {chipTypeForUserRole} from "../utils/Authority";
14+
import {authorityForRole, chipTypeForUserRole} from "../utils/Authority";
1515
import AlertLogo from "@surfnet/sds/icons/functional-icons/alert-circle.svg";
1616

1717
export const Application = () => {
@@ -89,9 +89,13 @@ export const Application = () => {
8989
{
9090
key: "authority",
9191
header: I18n.t("roles.authority"),
92-
mapper: role => <Chip type={chipTypeForUserRole(role.authority)}
93-
label={role.isUserRole ? I18n.t(`access.${role.authority}`) :
94-
I18n.t("roles.noMember")}/>
92+
mapper: role => {
93+
const type = chipTypeForUserRole(role.authority);
94+
const authority = authorityForRole(user, role);
95+
return <Chip type={type}
96+
label={isEmpty(authority) ? I18n.t("roles.noMember") :
97+
I18n.t(`access.${authority}`)}/>
98+
}
9599
},
96100
{
97101
key: "userRoleCount",

0 commit comments

Comments
 (0)