effective_roles 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/concerns/acts_as_role_restricted.rb +3 -1
- data/lib/effective_roles.rb +1 -1
- data/lib/effective_roles/engine.rb +0 -7
- data/lib/effective_roles/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dcace94c980b6d3d8ca8e2e3a89ff62ddf29048
|
4
|
+
data.tar.gz: 2c67c15ec721d5e346095ed9bcab84b12af3500e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f88182a9352373f99b95eef827fcb827a642e866cda029c5fb29caf9a1680c2aa6b089321295f853d541e0d2f452987687b8ee7992f52e6134cfae5e9bcb2423
|
7
|
+
data.tar.gz: b6ba9bb14af5d0bba32135aacc92955dffb5d3498d88884da0f095b29b37d675c8aeed00c4301729637b409fe37d1181f6c9a98104c40a532c18c67300f315f6
|
data/README.md
CHANGED
@@ -57,7 +57,9 @@ module ActsAsRoleRestricted
|
|
57
57
|
|
58
58
|
roles = (roles.map { |role| role.to_sym } & EffectiveRoles.roles)
|
59
59
|
|
60
|
-
where(
|
60
|
+
where(
|
61
|
+
roles.map { |role| "NOT(#{self.table_name}.roles_mask & %d > 0)" % 2**EffectiveRoles.roles.index(role) }.join(' AND ')
|
62
|
+
).or(where(roles_mask: nil))
|
61
63
|
end
|
62
64
|
end
|
63
65
|
|
data/lib/effective_roles.rb
CHANGED
@@ -53,7 +53,7 @@ module EffectiveRoles
|
|
53
53
|
def self.roles_collection(obj = nil, user = nil)
|
54
54
|
assignable_roles_for(user, obj).map do |role|
|
55
55
|
[
|
56
|
-
"#{role}<p class='help-block'>#{role_description(role, obj)}</p>".html_safe,
|
56
|
+
"#{role}<p class='help-block text-muted'>#{role_description(role, obj)}</p>".html_safe,
|
57
57
|
role,
|
58
58
|
({:disabled => :disabled} if disabled_roles_for(obj).include?(role))
|
59
59
|
]
|
@@ -4,13 +4,6 @@ module EffectiveRoles
|
|
4
4
|
|
5
5
|
config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
|
6
6
|
|
7
|
-
# Include Helpers to base application
|
8
|
-
initializer 'effective_roles.action_controller' do |app|
|
9
|
-
ActiveSupport.on_load :action_controller do
|
10
|
-
helper EffectiveRolesHelper
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
7
|
# Include acts_as_addressable concern and allow any ActiveRecord object to call it
|
15
8
|
initializer 'effective_roles.active_record' do |app|
|
16
9
|
ActiveSupport.on_load :active_record do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_roles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|