Last active
March 28, 2016 12:47
-
-
Save DeadAlready/f30733205e0232efbb4f to your computer and use it in GitHub Desktop.
Functional role definitions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let roles = { | |
manager: { | |
can: ['publish'], | |
inherits: ['writer'] | |
}, | |
writer: { | |
can: ['write', { | |
name: 'edit', | |
when: function (params) { | |
return params.user.id === params.post.owner; | |
} | |
}], | |
inherits: ['guest'] | |
}, | |
guest: { | |
can: ['read'] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment