Skip to content

Commit

Permalink
Updated documentation with an example using RegExp
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscogouveia committed Mar 4, 2017
1 parent c203af4 commit 4fdbbc2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ const context = {
dataRetrieverRouter.setContext(context);

const policy = {
target: [{ 'credentials:username': 'francisco' }, { 'credentials:group': 'admin' }], // if username is 'francisco' OR group is 'admin'
target: [{ 'credentials:username': 'francisco' }, { 'credentials:group': /^articles\:.*$/ }], // if username is 'francisco' OR group matches 'articles:*' (using native javascript RegExp)
apply: 'deny-overrides', // permit, unless one denies
rules: [
{
target: { 'credentials:group': 'admin', 'credentials:validated': false }, // if group is 'admin' AND is not validated
target: { 'credentials:group': 'articles:admin', 'credentials:validated': false }, // if group is 'articles:admin' AND is not validated
effect: 'deny' // then deny (deny access to users that are not validated)
},
{
Expand Down

0 comments on commit 4fdbbc2

Please sign in to comment.