Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

document dynamic roles

  • Loading branch information...
commit aa146a0a6416064b57b12f4ef77e11166cd8e59e 1 parent 7d7eaa4
@carlos8f authored
Showing with 20 additions and 2 deletions.
  1. +20 −2
@@ -24,8 +24,26 @@ relations.define('repos', {
Defining the context makes available a method on `relations` that matches the
-context name, in this case, `relations.repos()`. This is the only method we'll
-need to call.
+context name, in this case, `relations.repos()`. For permission checks, this is
+the only method we'll need to call.
+### Dynamic roles
+To add or modify roles at runtime, you can also use the following methods:
+// add a role dynamically
+relations.repos.addRole('scientist', ['test', 'hyphothesize']);
+// update the actions for a role
+relations.repos.updateRole('scientist', ['test', 'hypothesize', 'absquatulate']);
+// remove a role
+**Please note** that the role -> action map is defined exclusively in the code,
+and not stored. If you run a cluster of servers, and choose to use dynamic roles,
+you must call `addRole()` etc on ALL servers in the cluster (I suggest using

0 comments on commit aa146a0

Please sign in to comment.
Something went wrong with that request. Please try again.