Skip to content

Instantly share code, notes, and snippets.

@stalniy
Created July 27, 2017 12:30
Show Gist options
  • Save stalniy/21a9f50457bcb2eb5cdd5a498ad1ccb0 to your computer and use it in GitHub Desktop.
Save stalniy/21a9f50457bcb2eb5cdd5a498ad1ccb0 to your computer and use it in GitHub Desktop.
Aurelia CASL value converter
import { Ability } from 'casl'
export class CanValueConverter {
static inject = [Ability]
constructor(ability) {
this.ability = ability
}
toView(subject, action) {
return this.ability.can(action, subject)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment