Skip to content

Commit

Permalink
web/admin: show user internal service account as disabled (#9464)
Browse files Browse the repository at this point in the history
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
  • Loading branch information
BeryJu authored Apr 26, 2024
1 parent 6c4a185 commit 15ef5dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions web/src/admin/users/UserForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ export class UserForm extends ModelForm<User, number> {
"Service accounts should be used for machine-to-machine authentication or other automations.",
)}`,
},
{
label: "Internal Service account",
value: UserTypeEnum.InternalServiceAccount,
disabled: true,
description: html`${msg(
"Internal Service accounts are created and managed by authentik and cannot be created manually.",
)}`,
},
]}
.value=${this.instance?.type}
>
Expand Down
5 changes: 5 additions & 0 deletions web/src/elements/forms/Radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface RadioOption<T> {
description?: TemplateResult;
default?: boolean;
value: T;
disabled?: boolean;
}

@customElement("ak-radio")
Expand Down Expand Up @@ -77,6 +78,9 @@ export class Radio<T> extends CustomEmitterElement(AKElement) {
// This is a controlled input. Stop the native event from escaping or affecting the
// value. We'll do that ourselves.
ev.stopPropagation();
if (option.disabled) {
return;
}
this.value = option.value;
this.dispatchCustomEvent("change", { value: option.value });
this.dispatchCustomEvent("input", { value: option.value });
Expand All @@ -93,6 +97,7 @@ export class Radio<T> extends CustomEmitterElement(AKElement) {
name="${this.name}"
id=${elId}
.checked=${option.value === this.value}
.disabled=${option.disabled}
/>
<label class="pf-c-radio__label" for=${elId}>${option.label}</label>
${option.description
Expand Down

0 comments on commit 15ef5dc

Please sign in to comment.