mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-26 04:23:58 +03:00
parent
00df852580
commit
3e7e3cab66
@ -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)
|
||||
|
||||
|
@ -14,7 +14,16 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import contact, { Person, PersonAccount, Employee } from '@hcengineering/contact'
|
||||
import { Account, AccountRole, DocumentQuery, getCurrentAccount, Ref, SortingOrder, Space } from '@hcengineering/core'
|
||||
import {
|
||||
Account,
|
||||
AccountRole,
|
||||
DocumentQuery,
|
||||
getCurrentAccount,
|
||||
Ref,
|
||||
roleOrder,
|
||||
SortingOrder,
|
||||
Space
|
||||
} from '@hcengineering/core'
|
||||
import { translate } from '@hcengineering/platform'
|
||||
import presentation, { getClient } from '@hcengineering/presentation'
|
||||
import { ActionIcon, IconAdd, IconClose, Label, SearchEdit, showPopup, themeStore } from '@hcengineering/ui'
|
||||
@ -77,7 +86,7 @@
|
||||
}
|
||||
|
||||
const account = getCurrentAccount()
|
||||
$: canRemove = account.role >= AccountRole.Maintainer && space.createdBy === account._id
|
||||
$: canRemove = roleOrder[account.role] >= roleOrder[AccountRole.Maintainer] && space.createdBy === account._id
|
||||
</script>
|
||||
|
||||
<div class="flex-row-reverse mb-3 mt-3"><SearchEdit bind:value={search} /></div>
|
||||
|
@ -13,7 +13,7 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { AccountRole, getCurrentAccount, Timestamp } from '@hcengineering/core'
|
||||
import { AccountRole, getCurrentAccount, roleOrder, Timestamp } from '@hcengineering/core'
|
||||
import { loginId } from '@hcengineering/login'
|
||||
import { getMetadata } from '@hcengineering/platform'
|
||||
import presentation, { copyTextToClipboard, createQuery } from '@hcengineering/presentation'
|
||||
@ -108,7 +108,7 @@
|
||||
let limit: number | undefined = undefined
|
||||
let useDefault: boolean | undefined = true
|
||||
let noLimit: boolean = false
|
||||
const isOwnerOrMaintainer: boolean = getCurrentAccount().role > AccountRole.Maintainer
|
||||
const isOwnerOrMaintainer: boolean = roleOrder[getCurrentAccount().role] > roleOrder[AccountRole.Maintainer]
|
||||
let defaultValues: InviteParams = {
|
||||
expirationTime: 1,
|
||||
emailMask: '',
|
||||
|
@ -23,7 +23,8 @@ import core, {
|
||||
type Client,
|
||||
type Doc,
|
||||
type Ref,
|
||||
type WithLookup
|
||||
type WithLookup,
|
||||
roleOrder
|
||||
} from '@hcengineering/core'
|
||||
import { getResource } from '@hcengineering/platform'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
@ -198,7 +199,7 @@ export function filterActions (
|
||||
if (ignore.includes(action._id)) {
|
||||
continue
|
||||
}
|
||||
if (role < AccountRole.Maintainer && action.secured === true) {
|
||||
if (roleOrder[role] < roleOrder[AccountRole.Maintainer] && action.secured === true) {
|
||||
continue
|
||||
}
|
||||
if (
|
||||
|
Loading…
Reference in New Issue
Block a user