acl9 0.12.1 → 0.12.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/VERSION.yml +1 -1
- data/lib/acl9/model_extensions/for_subject.rb +9 -9
- data/lib/acl9/version.rb +1 -1
- metadata +57 -38
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9cf5698a2cdcb08b487fcf12489cd1c81ad11632
|
4
|
+
data.tar.gz: 6bc6c991ab649844d121a7d6cb44c1cbfe2cbed9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6de6962b498a7a45b816adf1af36d899e353394995d448aea35fc66de34f12fd5f5bf94c259ed7a8a8154b727b46eca552b91e3db3f5b48f4e8dbcd297ade3f7
|
7
|
+
data.tar.gz: 4519cbc997338a70ab3d1c1083ef9ae1f2fa7496883c4b7e5af9621d2d126c6a286f3d22d7a01f193fd9ef96a36d1cd5fdffe67c25f076b0d06b3df438f68c46
|
data/VERSION.yml
CHANGED
@@ -36,11 +36,11 @@ module Acl9
|
|
36
36
|
# @see Acl9::ModelExtensions::Object#accepts_role?
|
37
37
|
def has_role?(role_name, object = nil)
|
38
38
|
!! if object.nil? && !::Acl9.config[:protect_global_roles]
|
39
|
-
self.
|
40
|
-
self.
|
39
|
+
self._role_objects.find_by_name(role_name.to_s) ||
|
40
|
+
self._role_objects.member?(get_role(role_name, nil))
|
41
41
|
else
|
42
42
|
role = get_role(role_name, object)
|
43
|
-
role && self.
|
43
|
+
role && self._role_objects.exists?(role.id)
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -63,7 +63,7 @@ module Acl9
|
|
63
63
|
role = self._auth_role_class.create(role_attrs)
|
64
64
|
end
|
65
65
|
|
66
|
-
self.
|
66
|
+
self._role_objects << role if role && !self._role_objects.exists?(role.id)
|
67
67
|
end
|
68
68
|
|
69
69
|
##
|
@@ -83,7 +83,7 @@ module Acl9
|
|
83
83
|
# @return [Boolean] Returns true if +self+ has any roles on +object+.
|
84
84
|
# @see Acl9::ModelExtensions::Object#accepts_roles_by?
|
85
85
|
def has_roles_for?(object)
|
86
|
-
!!self.
|
86
|
+
!!self._role_objects.detect(&role_selecting_lambda(object))
|
87
87
|
end
|
88
88
|
|
89
89
|
alias :has_role_for? :has_roles_for?
|
@@ -100,7 +100,7 @@ module Acl9
|
|
100
100
|
#
|
101
101
|
# user.roles_for(product).map(&:name).sort #=> role names in alphabetical order
|
102
102
|
def roles_for(object)
|
103
|
-
self.
|
103
|
+
self._role_objects.select(&role_selecting_lambda(object))
|
104
104
|
end
|
105
105
|
|
106
106
|
##
|
@@ -119,7 +119,7 @@ module Acl9
|
|
119
119
|
# self.roles.each { |role| delete_role(role) }
|
120
120
|
#
|
121
121
|
# doesn't work. seems like a bug in ActiveRecord
|
122
|
-
self.
|
122
|
+
self._role_objects.map(&:id).each do |role_id|
|
123
123
|
delete_role self._auth_role_class.find(role_id)
|
124
124
|
end
|
125
125
|
end
|
@@ -160,7 +160,7 @@ module Acl9
|
|
160
160
|
|
161
161
|
def delete_role(role)
|
162
162
|
if role
|
163
|
-
self.
|
163
|
+
self._role_objects.delete role
|
164
164
|
if role.send(self._auth_subject_class_name.demodulize.tableize).empty?
|
165
165
|
role.destroy unless role.respond_to?(:system?) && role.system?
|
166
166
|
end
|
@@ -177,7 +177,7 @@ module Acl9
|
|
177
177
|
self.class._auth_role_assoc_name
|
178
178
|
end
|
179
179
|
|
180
|
-
def
|
180
|
+
def _role_objects
|
181
181
|
send(self._auth_role_assoc)
|
182
182
|
end
|
183
183
|
end
|
data/lib/acl9/version.rb
CHANGED
metadata
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acl9
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
5
|
-
prerelease:
|
4
|
+
version: 0.12.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- oleg dashevskii
|
@@ -13,81 +12,102 @@ date: 2010-11-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
|
-
requirement:
|
17
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 2.3.12
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.12
|
25
27
|
- !ruby/object:Gem::Dependency
|
26
28
|
name: be9-context
|
27
|
-
requirement:
|
28
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
|
-
- -
|
31
|
+
- - ">="
|
31
32
|
- !ruby/object:Gem::Version
|
32
33
|
version: 0.5.5
|
33
34
|
type: :development
|
34
35
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.5.5
|
36
41
|
- !ruby/object:Gem::Dependency
|
37
42
|
name: jnunemaker-matchy
|
38
|
-
requirement:
|
39
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
40
44
|
requirements:
|
41
|
-
- -
|
45
|
+
- - ">="
|
42
46
|
- !ruby/object:Gem::Version
|
43
47
|
version: 0.4.0
|
44
48
|
type: :development
|
45
49
|
prerelease: false
|
46
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.4.0
|
47
55
|
- !ruby/object:Gem::Dependency
|
48
56
|
name: rake
|
49
|
-
requirement:
|
50
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
51
58
|
requirements:
|
52
|
-
- -
|
59
|
+
- - ">="
|
53
60
|
- !ruby/object:Gem::Version
|
54
61
|
version: '0'
|
55
62
|
type: :development
|
56
63
|
prerelease: false
|
57
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
58
69
|
- !ruby/object:Gem::Dependency
|
59
70
|
name: yard
|
60
|
-
requirement:
|
61
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
62
72
|
requirements:
|
63
|
-
- -
|
73
|
+
- - ">="
|
64
74
|
- !ruby/object:Gem::Version
|
65
75
|
version: '0'
|
66
76
|
type: :development
|
67
77
|
prerelease: false
|
68
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: sqlite3
|
71
|
-
requirement:
|
72
|
-
none: false
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
73
86
|
requirements:
|
74
|
-
- -
|
87
|
+
- - ">="
|
75
88
|
- !ruby/object:Gem::Version
|
76
89
|
version: '0'
|
77
90
|
type: :development
|
78
91
|
prerelease: false
|
79
|
-
version_requirements:
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
80
97
|
- !ruby/object:Gem::Dependency
|
81
98
|
name: turn
|
82
|
-
requirement:
|
83
|
-
none: false
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
84
100
|
requirements:
|
85
|
-
- -
|
101
|
+
- - ">="
|
86
102
|
- !ruby/object:Gem::Version
|
87
103
|
version: '0'
|
88
104
|
type: :development
|
89
105
|
prerelease: false
|
90
|
-
version_requirements:
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
91
111
|
description: Role-based authorization system for Rails with a nice DSL for access
|
92
112
|
control lists
|
93
113
|
email:
|
@@ -98,7 +118,7 @@ extra_rdoc_files:
|
|
98
118
|
- README.textile
|
99
119
|
- TODO
|
100
120
|
files:
|
101
|
-
- .gitignore
|
121
|
+
- ".gitignore"
|
102
122
|
- CHANGELOG.textile
|
103
123
|
- Gemfile
|
104
124
|
- Gemfile.lock
|
@@ -129,28 +149,27 @@ files:
|
|
129
149
|
- test/version_test.rb
|
130
150
|
homepage: http://github.com/be9/acl9
|
131
151
|
licenses: []
|
152
|
+
metadata: {}
|
132
153
|
post_install_message:
|
133
154
|
rdoc_options:
|
134
|
-
- --charset=UTF-8
|
155
|
+
- "--charset=UTF-8"
|
135
156
|
require_paths:
|
136
157
|
- lib
|
137
158
|
required_ruby_version: !ruby/object:Gem::Requirement
|
138
|
-
none: false
|
139
159
|
requirements:
|
140
|
-
- -
|
160
|
+
- - ">="
|
141
161
|
- !ruby/object:Gem::Version
|
142
162
|
version: '0'
|
143
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
|
-
none: false
|
145
164
|
requirements:
|
146
|
-
- -
|
165
|
+
- - ">="
|
147
166
|
- !ruby/object:Gem::Version
|
148
167
|
version: '0'
|
149
168
|
requirements: []
|
150
169
|
rubyforge_project:
|
151
|
-
rubygems_version:
|
170
|
+
rubygems_version: 2.2.2
|
152
171
|
signing_key:
|
153
|
-
specification_version:
|
172
|
+
specification_version: 4
|
154
173
|
summary: Yet another role-based authorization system for Rails
|
155
174
|
test_files:
|
156
175
|
- test/access_control_test.rb
|