From 3e7e3cab668fdcfa38e6f285c6e69f344403af66 Mon Sep 17 00:00:00 2001 From: Denis Bykhov Date: Wed, 28 Feb 2024 14:15:07 +0600 Subject: [PATCH] Fix roles (#4806) Signed-off-by: Denis Bykhov --- .../src/components/EditEmployee.svelte | 4 ++-- .../src/components/SpaceMembers.svelte | 13 +++++++++++-- .../src/components/InviteLink.svelte | 4 ++-- plugins/view-resources/src/actions.ts | 5 +++-- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/contact-resources/src/components/EditEmployee.svelte b/plugins/contact-resources/src/components/EditEmployee.svelte index 8420830dcc..de6a10e7f3 100644 --- a/plugins/contact-resources/src/components/EditEmployee.svelte +++ b/plugins/contact-resources/src/components/EditEmployee.svelte @@ -23,7 +23,7 @@ getFirstName, getLastName } from '@hcengineering/contact' - import { AccountRole, Ref, getCurrentAccount } from '@hcengineering/core' + import { AccountRole, Ref, getCurrentAccount, roleOrder } from '@hcengineering/core' import { AttributeEditor, createQuery, getClient } from '@hcengineering/presentation' import setting, { IntegrationType } from '@hcengineering/setting' import { EditBox, FocusHandler, Scroller, createFocusManager } from '@hcengineering/ui' @@ -46,7 +46,7 @@ let avatarEditor: EditableAvatar $: owner = account.person === object._id - $: editable = !readonly && (account.role >= AccountRole.Maintainer || owner) + $: editable = !readonly && (roleOrder[account.role] >= roleOrder[AccountRole.Maintainer] || owner) let firstName = getFirstName(object.name) let lastName = getLastName(object.name) diff --git a/plugins/contact-resources/src/components/SpaceMembers.svelte b/plugins/contact-resources/src/components/SpaceMembers.svelte index 54b6b13f06..16e4351312 100644 --- a/plugins/contact-resources/src/components/SpaceMembers.svelte +++ b/plugins/contact-resources/src/components/SpaceMembers.svelte @@ -14,7 +14,16 @@ -->
diff --git a/plugins/login-resources/src/components/InviteLink.svelte b/plugins/login-resources/src/components/InviteLink.svelte index 4a32140135..a562d78780 100644 --- a/plugins/login-resources/src/components/InviteLink.svelte +++ b/plugins/login-resources/src/components/InviteLink.svelte @@ -13,7 +13,7 @@ // limitations under the License. -->