mirror of
https://github.com/hcengineering/platform.git
synced 2026-08-26 06:12:23 +02:00
17 lines
569 B
TypeScript
17 lines
569 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 canViewTraining (object: Training): boolean {
|
|
return (
|
|
object.owner === getCurrentEmployeeRef() ||
|
|
checkMyPermission(training.permission.ViewSomeoneElsesTrainingOverview, object.space, get(permissionsStore))
|
|
)
|
|
}
|