Skip to content

Commit

Permalink
updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Jul 15, 2010
1 parent 5527397 commit 79da68e
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,25 @@ groups are associations of a list of keys to a list of roles. groups can also "i

first, lets assume we have loaded the following dataset <a href = "exampleRoles.json">exampleRoles.json</a> using roles.load()

// basic permission checks
if("Marak".can('delete resources')){
sys.puts('Marak can delete resources');
}

if(!"Noob".can('delete resources')){
sys.puts('Noob cannot delete resources.');
}

if(!"Marak".cannot('delete resources')){
sys.puts('Marak can delete resources.');
}

if("Noob".cannot('delete resources')){
sys.puts('Noob cannot delete resources.');
}
###basic permission checks

(all the following statements will evaluate to "true")

if("Marak".can('delete resources')){
sys.puts('Marak can delete resources');
}

if(!"Noob".can('delete resources')){
sys.puts('Noob cannot delete resources.');
}

if(!"Marak".cannot('delete resources')){
sys.puts('Marak can delete resources.');
}

if("Noob".cannot('delete resources')){
sys.puts('Noob cannot delete resources.');
}

##faq

Expand Down

0 comments on commit 79da68e

Please sign in to comment.