Skip to content

Instantly share code, notes, and snippets.

@mblarsen
Created October 25, 2017 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mblarsen/f2f99651da7638ff75e56d0a57fcb54a to your computer and use it in GitHub Desktop.
Save mblarsen/f2f99651da7638ff75e56d0a57fcb54a to your computer and use it in GitHub Desktop.
import Vue from 'vue'
import Acl from 'vue-browser-acl'
Vue.use(Acl, user, (acl) => {
acl.rule(view, Post)
acl.rule([edit, delete], Post, (user, post) => post.userId === user.id)
acl.rule('moderate', Post, (user) => user.isModerator())
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment