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