Fix settins roles check (#4789)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2024-02-27 20:33:32 +06:00 committed by GitHub
parent 0c8f00d24a
commit 2f7f3118fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { PersonAccount } from '@hcengineering/contact'
import { AccountRole, getCurrentAccount } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, roleOrder } from '@hcengineering/core'
import login, { loginId } from '@hcengineering/login'
import { setMetadata } from '@hcengineering/platform'
import presentation, { closeClient, createQuery } from '@hcengineering/presentation'
@ -57,7 +57,7 @@
setting.class.SettingsCategory,
{},
(res) => {
categories = account.role > AccountRole.User ? res : res.filter((p) => !p.secured)
categories = roleOrder[account.role] > roleOrder[AccountRole.User] ? res : res.filter((p) => !p.secured)
category = findCategory(categoryId)
},
{ sort: { order: 1 } }

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { PersonAccount } from '@hcengineering/contact'
import { AccountRole, getCurrentAccount } from '@hcengineering/core'
import { AccountRole, getCurrentAccount, roleOrder } from '@hcengineering/core'
import { createQuery } from '@hcengineering/presentation'
import setting, { SettingsCategory } from '@hcengineering/setting'
import {
@ -43,7 +43,7 @@
setting.class.WorkspaceSettingCategory,
{},
(res) => {
categories = account.role > AccountRole.User ? res : res.filter((p) => !p.secured)
categories = roleOrder[account.role] > roleOrder[AccountRole.User] ? res : res.filter((p) => !p.secured)
category = findCategory(categoryId)
},
{ sort: { order: 1 } }

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import contact, { Employee, PersonAccount, formatName } from '@hcengineering/contact'
import { AccountRole, Ref, getCurrentAccount } from '@hcengineering/core'
import { AccountRole, Ref, getCurrentAccount, roleOrder } from '@hcengineering/core'
import login from '@hcengineering/login'
import { createQuery } from '@hcengineering/presentation'
import setting, { SettingsCategory, settingId } from '@hcengineering/setting'
@ -41,7 +41,7 @@
setting.class.SettingsCategory,
{},
(res) => {
items = account.role > AccountRole.User ? res : res.filter((p) => !p.secured)
items = roleOrder[account.role] > roleOrder[AccountRole.User] ? res : res.filter((p) => !p.secured)
},
{ sort: { order: 1 } }
)