From 1074cad5dccf2a77b4e249b0d0ded1e48584db5b Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:58:34 -0500 Subject: [PATCH] feat: disable admin option when using LDAP auth (#2583) * fix typo * add override readonly/disable support for autoform * made admin permission conditionally disabled --- frontend/components/global/AutoForm.vue | 22 +++++++++++++++------- frontend/lang/messages/en-US.json | 2 +- frontend/pages/admin/manage/users/_id.vue | 8 ++++++-- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/frontend/components/global/AutoForm.vue b/frontend/components/global/AutoForm.vue index 8ad0cbcd9e41..f92acf2e9756 100644 --- a/frontend/components/global/AutoForm.vue +++ b/frontend/components/global/AutoForm.vue @@ -18,7 +18,7 @@ :label="inputField.label" :name="inputField.varName" :hint="inputField.hint || ''" - :disabled="(inputField.disableUpdate && updateMode) || (!updateMode && inputField.disableCreate)" + :disabled="(inputField.disableUpdate && updateMode) || (!updateMode && inputField.disableCreate) || (disabledFields && disabledFields.includes(inputField.varName))" @change="emitBlur" /> @@ -26,8 +26,8 @@ string[], + }, + readonlyFields: { + default: null, + type: Array as () => string[], + }, }, setup(props, context) { function rulesByKey(keys?: ValidatorKey[] | null) { diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json index 3dfff7a6a12d..13b3a7eafc3d 100644 --- a/frontend/lang/messages/en-US.json +++ b/frontend/lang/messages/en-US.json @@ -858,7 +858,7 @@ "user-details": "User Details", "user-name": "User Name", "authentication-method": "Authentication Method", - "authentication-method-hint": "This specifies how a user will authenticate with Mealie. If you're not sure, choose 'Mealie", + "authentication-method-hint": "This specifies how a user will authenticate with Mealie. If you're not sure, choose 'Mealie'", "permissions": "Permissions", "administrator": "Administrator", "user-can-invite-other-to-group": "User can invite other to group", diff --git a/frontend/pages/admin/manage/users/_id.vue b/frontend/pages/admin/manage/users/_id.vue index 1ddf88ec57c9..c32774a24ace 100644 --- a/frontend/pages/admin/manage/users/_id.vue +++ b/frontend/pages/admin/manage/users/_id.vue @@ -34,7 +34,7 @@ - +
@@ -45,7 +45,7 @@