effective_roles 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/effective_roles.rb +3 -2
- data/lib/effective_roles/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06f6a3d9bee34bb09cb46dca52cf1d7837ed636c9a1888e244aff16c1f8b772c
|
4
|
+
data.tar.gz: 708a5daa2f874de24e5fe8b80f1cd1e4731d9fc30630f18ab16c666d47749e34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a960a0fc29fbfec810675e507628dcf4c6aa2327685866c02e51d267a163869e3ed19c9f6cb92b3ceb7f21315c4d6c42f1f7e19efa374f944970778cf62ad3c7
|
7
|
+
data.tar.gz: 5d51969cfd0d88df911f5c79c550ce5085422ba82670250bb93781f5d95c298578d8c5b5c74bc3dfe4744f04b216ea2aaa00bccfefd097cf24491a5548d1f4a6
|
data/lib/effective_roles.rb
CHANGED
@@ -104,10 +104,11 @@ module EffectiveRoles
|
|
104
104
|
assignable = if assignable_roles.kind_of?(Array)
|
105
105
|
assignable_roles
|
106
106
|
elsif current_user.present?
|
107
|
-
current_roles = assignable_roles[resource.
|
107
|
+
current_roles = assignable_roles[resource.class.to_s] || assignable_roles || {}
|
108
108
|
current_user.roles.map { |role| current_roles[role] }.flatten.compact.uniq
|
109
109
|
else
|
110
|
-
assignable_roles[resource.
|
110
|
+
current_roles = assignable_roles[resource.class.to_s] || assignable_roles || {}
|
111
|
+
current_roles.values.flatten.uniq
|
111
112
|
end
|
112
113
|
|
113
114
|
# Check boxes
|