web/flows: only show permission ids if we have to, hide them if permission list has permissions with description

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2022-08-09 17:51:28 +02:00
parent f1b167c134
commit fb08e1db2b
2 changed files with 7 additions and 3 deletions

View File

@ -10,6 +10,7 @@ entries:
attrs: attrs:
name: "authentik default OAuth Mapping: Proxy outpost" name: "authentik default OAuth Mapping: Proxy outpost"
scope_name: ak_proxy scope_name: ak_proxy
description: authentik Proxy - User information
expression: | expression: |
# This mapping is used by the authentik proxy. It passes extra user attributes, # This mapping is used by the authentik proxy. It passes extra user attributes,
# which are used for example for the HTTP-Basic Authentication mapping. # which are used for example for the HTTP-Basic Authentication mapping.

View File

@ -37,10 +37,13 @@ export class ConsentStage extends BaseStage<ConsentChallenge, ConsentChallengeRe
} }
renderPermissions(perms: Permission[]): TemplateResult { renderPermissions(perms: Permission[]): TemplateResult {
const shouldShowId = perms.filter((perm) => perm.name === "").length === perms.length;
return html`${perms.map((permission) => { return html`${perms.map((permission) => {
return html`<li data-permission-code="${permission.id}"> let name = permission.name;
${permission.name === "" ? permission.id : permission.name} if (permission.name === "" && shouldShowId) {
</li>`; name = permission.id;
}
return html`<li data-permission-code="${permission.id}">${name}</li>`;
})}`; })}`;
} }