import { BaseAuth } from '../../../../../lib' ; import { ForbiddenError } from '../../../../../lib/error' ; import { opt } from '../../../../../lib/auth/BaseAuth' ; export class DefaultAuth extends BaseAuth { async has ( ) { return true ; } } export class NeedParamAuth extends BaseAuth { async has ( id ) { return id === '123' ; } } export class ForbiddenAuth extends BaseAuth { has ( ) { throw new ForbiddenError ( ) ; } } export class OptParamAuth extends BaseAuth { async has ( @ opt ( ) id ) { return ! id || id === 'opt' ; } }