import { DomainError } from "@cv/system"; export abstract class AuthorizationError extends DomainError {} export class CannotViewError extends AuthorizationError { constructor(resourceType: string) { super( "AUTHORIZATION_CANNOT_VIEW", `You are not authorized to view this ${resourceType}`, { resourceType }, ); } } export class CannotCreateError extends AuthorizationError { constructor(resourceType: string) { super( "AUTHORIZATION_CANNOT_CREATE", `You are not authorized to create ${resourceType}`, { resourceType }, ); } } export class CannotUpdateError extends AuthorizationError { constructor(resourceType: string) { super( "AUTHORIZATION_CANNOT_UPDATE", `You are not authorized to update this ${resourceType}`, { resourceType }, ); } } export class CannotDeleteError extends AuthorizationError { constructor(resourceType: string) { super( "AUTHORIZATION_CANNOT_DELETE", `You are not authorized to delete this ${resourceType}`, { resourceType }, ); } }