role_authorization 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,16 @@ RoleAuthorization::Rules.define :all do
3
3
  end
4
4
 
5
5
  RoleAuthorization::Rules.define :role do
6
+ scope = if options[:scope]
7
+ if options[:scope].is_a?(Proc)
8
+ instance_eval(&options[:scope])
9
+ else
10
+ options[:scope]
11
+ end
12
+ else
13
+ :global
14
+ end
15
+
6
16
  controller_instance.current_user.roles(options[:scope] || :global).include?(role)
7
17
  end
8
18
 
@@ -1,3 +1,3 @@
1
1
  module RoleAuthorization
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: role_authorization
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.1
5
+ version: 0.3.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - John 'asceth' Long
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-16 00:00:00 -04:00
13
+ date: 2011-03-17 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency