EndemolShineGroup/acl

View on GitHub
src/Steps/DenyStep.ts

Summary

Maintainability
A
2 hrs
Test Coverage
import DenyPermissionStep from './DenyPermissionStep';
import Step from './Step';

import PermissionResolver from '../Resolvers/PermissionResolver';

export default class DenyStep extends Step {
  permission(...permissions: string[]): DenyPermissionStep {
    return new DenyPermissionStep(
      {
        ...this.query,
        permissions: PermissionResolver(
          this.rolesStore,
          this.query.roles!,
          ...permissions,
        ),
      },
      this.rolesStore,
    );
  }
}