Skip to content

Commit

Permalink
Adapt copy to new examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy Davis committed Jul 9, 2012
1 parent 27910a2 commit 5cb2b6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -75,7 +75,7 @@ john.can_destroy?(ruby) # true
steve.can_destroy?(ruby) # false
```

In one common pattern, a single permission flag controls whether or not users can perform multiple administrator-specific operations. Canable can honor that flag with:
Now we can implement our permissions for each resource and then always check whether a user can or cannot do something. This makes it all really easy to test. In one common pattern, a single permission flag controls whether or not users can perform multiple administrator-specific operations. Canable can honor that flag with:

```ruby
def writable_by?(user)
Expand All @@ -86,7 +86,7 @@ alias_method :updatable_by?, :writable_by?
alias_method :destroyable_by?, :writable_by?
```

Now we can implement our permissions for each resource and then always check whether a user can or cannot do something. This makes it all really easy to test. Next, how would you use this in the controller.
Next, how would you use this in the controller.

## Enforcers

Expand Down

0 comments on commit 5cb2b6e

Please sign in to comment.