Permalink
Browse files

Do..end looks nicer here

  • Loading branch information...
1 parent 3ce2f2f commit 6ece4932aeaf63349f6b0427252e13e478d5d326 @nathanl committed Apr 7, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −2 README.markdown
  2. +3 −2 lib/authority/configuration.rb
View
@@ -182,10 +182,10 @@ You can configure a different default strategy. For example, you might want one
```ruby
# In config/initializers/authority.rb
-config.default_strategy = Proc.new { |able, authorizer, user|
+config.default_strategy = Proc.new do |able, authorizer, user|
# Does the user have any of the roles which give this permission?
(roles_which_grant(able, authorizer) & user.roles).any?
-}
+end
```
If your system is uniform enough, **this strategy alone might handle all the logic you need**.
@@ -6,9 +6,10 @@ class Configuration
attr_accessor :default_strategy, :abilities, :controller_action_map, :user_method, :logger
def initialize
- @default_strategy = Proc.new { |able, authorizer, user|
+ @default_strategy = Proc.new do |able, authorizer, user|
false
- }
+ end
+
@abilities = {
:create => 'creatable',

0 comments on commit 6ece493

Please sign in to comment.