mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-02 14:29:03 +02:00
17 lines
599 B
TypeScript
17 lines
599 B
TypeScript
//
|
|
// Copyright @ 2024 Hardcore Engineering Inc.
|
|
//
|
|
|
|
import { checkMyPermission, permissionsStore } from '@hcengineering/contact-resources'
|
|
import type { Training } from '@hcengineering/training'
|
|
import { get } from 'svelte/store'
|
|
import { getCurrentEmployeeRef } from './getCurrentEmployeeRef'
|
|
import training from '../plugin'
|
|
|
|
export function canChangeTrainingOwner (trainingObject: Training): boolean {
|
|
return (
|
|
trainingObject.owner === getCurrentEmployeeRef() &&
|
|
checkMyPermission(training.permission.ChangeSomeoneElsesTrainingOwner, trainingObject.space, get(permissionsStore))
|
|
)
|
|
}
|