UNPKG

scrivito

Version:

Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.

18 lines (14 loc) 418 B
import { ScopeTransformation } from 'scrivito_sdk/models'; export function restrictToContent(contentId: string): ScopeTransformation { return { isInScope(obj) { return obj.contentId() === contentId; }, applyToSearch(search) { return search.and('_contentId', 'equals', contentId); }, applyToCreate(attributes) { return { ...attributes, _content_id: contentId }; }, }; }