acts_as_authoritah 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -13,7 +13,8 @@ module ActsAsAuthoritah
|
|
13
13
|
module InstanceMethods
|
14
14
|
def can?(identifier, options={})
|
15
15
|
klass = self.class
|
16
|
-
klass.send(:default_acl).match_identifier(identifier)
|
16
|
+
h = klass.send(:default_acl).match_identifier(identifier)
|
17
|
+
h.empty? ? !klass.send(:whitelist) : h[self.usertype(options)]
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
@@ -29,7 +30,7 @@ module ActsAsAuthoritah
|
|
29
30
|
end
|
30
31
|
|
31
32
|
def whitelist
|
32
|
-
|
33
|
+
@@whitelist
|
33
34
|
end
|
34
35
|
end
|
35
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
1
3
|
describe ActsAsAuthoritah::Core do
|
2
4
|
before :each do
|
3
5
|
class Foo
|
@@ -29,7 +31,7 @@ describe ActsAsAuthoritah::Core do
|
|
29
31
|
before :each do
|
30
32
|
class Foo
|
31
33
|
include ActsAsAuthoritah::Core
|
32
|
-
acts_as_authoritah "spec/data/default.xls"
|
34
|
+
acts_as_authoritah "spec/data/default.xls", :whitelist => false
|
33
35
|
|
34
36
|
def usertype(options)
|
35
37
|
"admin"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_authoritah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-04 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2151759200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2151759200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &2151758620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2151758620
|
36
36
|
description: Define user capabilities in your app
|
37
37
|
email:
|
38
38
|
- unni.tallman@gmail.com
|