stalniy/casl

View on GitHub
packages/casl-aurelia/src/index.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { FrameworkConfiguration } from 'aurelia-framework';
import { PureAbility, AnyAbility } from '@casl/ability';
import { CanValueConverter, AbleValueConverter } from './value-converter/can';

export { CanValueConverter, AbleValueConverter } from './value-converter/can';

export function configure(config: FrameworkConfiguration, defaultAbility?: AnyAbility) {
  if (defaultAbility && defaultAbility instanceof PureAbility) {
    config.container.registerInstance(PureAbility, defaultAbility);
  }

  config.globalResources([
    CanValueConverter,
    AbleValueConverter
  ]);
}