import { useService } from '@cloudbeaver/core-di' ; import { PermissionsService } from './PermissionsService' ; export function usePermission ( key ) { const permissionsService = useService ( PermissionsService ) ; return permissionsService . has ( key ) ; }