mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-24 20:40:59 +00:00
Allow edit employee for owner (#2210)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
1f64039473
commit
ffd71bc9db
@ -15,8 +15,8 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import attachment from '@anticrm/attachment'
|
||||
import { combineName, getFirstName, getLastName, Person } from '@anticrm/contact'
|
||||
import { getCurrentAccount, Ref, Space } from '@anticrm/core'
|
||||
import { combineName, EmployeeAccount, getFirstName, getLastName, Person } from '@anticrm/contact'
|
||||
import { AccountRole, getCurrentAccount, Ref, Space } from '@anticrm/core'
|
||||
import { getResource } from '@anticrm/platform'
|
||||
import { AttributeEditor, Avatar, createQuery, EditableAvatar, getClient } from '@anticrm/presentation'
|
||||
import setting, { IntegrationType } from '@anticrm/setting'
|
||||
@ -29,8 +29,12 @@
|
||||
const client = getClient()
|
||||
|
||||
const hierarchy = client.getHierarchy()
|
||||
const account = getCurrentAccount() as EmployeeAccount
|
||||
|
||||
$: editable = !hierarchy.isDerived(object._class, contact.class.Employee)
|
||||
$: editable =
|
||||
!hierarchy.isDerived(object._class, contact.class.Employee) ||
|
||||
account.role === AccountRole.Owner ||
|
||||
object._id === account.employee
|
||||
let firstName = getFirstName(object.name)
|
||||
let lastName = getLastName(object.name)
|
||||
|
||||
@ -55,12 +59,11 @@
|
||||
})
|
||||
}
|
||||
|
||||
const accountId = getCurrentAccount()._id
|
||||
let integrations: Set<Ref<IntegrationType>> = new Set<Ref<IntegrationType>>()
|
||||
const settingsQuery = createQuery()
|
||||
$: settingsQuery.query(
|
||||
setting.class.Integration,
|
||||
{ space: accountId as string as Ref<Space>, disabled: false },
|
||||
{ space: account._id as string as Ref<Space>, disabled: false },
|
||||
(res) => {
|
||||
integrations = new Set(res.map((p) => p.type))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user