effective_roles 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concerns/acts_as_role_restricted.rb +1 -1
- data/lib/effective_roles/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77423c072ab8659b9e632cebcd9fe939743abac4d0b374f12b3e144a70bcdfe1
|
4
|
+
data.tar.gz: 929bbf885819e6303f7a09ffe7c58988f4607403903b3dfdc3c141f175714eee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6917b11179747ff215fd926a595594de592b6881a3ca74c7b699fb52a1a0b482259ff2edddd0cd02d2eaebf8d265ebea506128641d32fb7f296567bad2466bf
|
7
|
+
data.tar.gz: 90a7d053382163c74cf8df9dee3d03b84239f4f39bd199d1b0ada04f124fd88b8ff4d7222dd8e3fce9f0eb37544c2bf386ab0a0d8c3a38ee9384b6b04b861907
|
@@ -29,7 +29,7 @@ module ActsAsRoleRestricted
|
|
29
29
|
|
30
30
|
validates :roles_mask, numericality: true, allow_nil: true
|
31
31
|
|
32
|
-
validate(if: -> { changes.include?(:roles_mask) && EffectiveRoles.assignable_roles_present?(self) }) do
|
32
|
+
validate(if: -> { changes.include?(:roles_mask) && EffectiveRoles.assignable_roles_present?(self) && current_user.present? }) do
|
33
33
|
roles_was = EffectiveRoles.roles_for(changes[:roles_mask].first)
|
34
34
|
changed = (roles + roles_was) - (roles & roles_was) # XOR
|
35
35
|
|
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: 2.
|
4
|
+
version: 2.2.0
|
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: 2021-
|
11
|
+
date: 2021-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|