mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00:00
Fix settins roles check (#4789)
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
0c8f00d24a
commit
2f7f3118fd
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PersonAccount } from '@hcengineering/contact'
|
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 login, { loginId } from '@hcengineering/login'
|
||||||
import { setMetadata } from '@hcengineering/platform'
|
import { setMetadata } from '@hcengineering/platform'
|
||||||
import presentation, { closeClient, createQuery } from '@hcengineering/presentation'
|
import presentation, { closeClient, createQuery } from '@hcengineering/presentation'
|
||||||
@ -57,7 +57,7 @@
|
|||||||
setting.class.SettingsCategory,
|
setting.class.SettingsCategory,
|
||||||
{},
|
{},
|
||||||
(res) => {
|
(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)
|
category = findCategory(categoryId)
|
||||||
},
|
},
|
||||||
{ sort: { order: 1 } }
|
{ sort: { order: 1 } }
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { PersonAccount } from '@hcengineering/contact'
|
import { PersonAccount } from '@hcengineering/contact'
|
||||||
import { AccountRole, getCurrentAccount } from '@hcengineering/core'
|
import { AccountRole, getCurrentAccount, roleOrder } from '@hcengineering/core'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import setting, { SettingsCategory } from '@hcengineering/setting'
|
import setting, { SettingsCategory } from '@hcengineering/setting'
|
||||||
import {
|
import {
|
||||||
@ -43,7 +43,7 @@
|
|||||||
setting.class.WorkspaceSettingCategory,
|
setting.class.WorkspaceSettingCategory,
|
||||||
{},
|
{},
|
||||||
(res) => {
|
(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)
|
category = findCategory(categoryId)
|
||||||
},
|
},
|
||||||
{ sort: { order: 1 } }
|
{ sort: { order: 1 } }
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import contact, { Employee, PersonAccount, formatName } from '@hcengineering/contact'
|
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 login from '@hcengineering/login'
|
||||||
import { createQuery } from '@hcengineering/presentation'
|
import { createQuery } from '@hcengineering/presentation'
|
||||||
import setting, { SettingsCategory, settingId } from '@hcengineering/setting'
|
import setting, { SettingsCategory, settingId } from '@hcengineering/setting'
|
||||||
@ -41,7 +41,7 @@
|
|||||||
setting.class.SettingsCategory,
|
setting.class.SettingsCategory,
|
||||||
{},
|
{},
|
||||||
(res) => {
|
(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 } }
|
{ sort: { order: 1 } }
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user