effective_roles 2.7.0 → 2.7.1
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 +3 -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: 8c1f1f6b5dd1700dcaa93ac9b8f57ffbdd20a131be00bded8702b5f07fa65f30
|
4
|
+
data.tar.gz: c1e9fca0b2f63631519bd7a2f3cae7c5ff8ca3bb51e867a163f4f8830f511190
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f00b6ad97bef4ec78ebc2b14b80e2ac0c3433e7bbda3cc40904339e0029af67e2bd90fd17f66e2ee71a2dc74f04432a9fddbad48074cd854affcd7b5e3d6db68
|
7
|
+
data.tar.gz: f3113726bb54b14fcf9c4a0224e82c504fb9854a138d79f3b5fd664aa0e4e2c7ec8e92e1483f3ac9834307f5e7d0a7cf87fc68bbdd9aea1dad052354ca4af069
|
@@ -24,12 +24,14 @@ module ActsAsRoleRestricted
|
|
24
24
|
included do
|
25
25
|
attr_accessor(:current_user) unless respond_to?(:current_user)
|
26
26
|
|
27
|
+
attr_accessor :skip_effective_roles_validation
|
28
|
+
|
27
29
|
acts_as_role_restricted_options = @acts_as_role_restricted_opts.dup
|
28
30
|
self.send(:define_method, :acts_as_role_restricted_options) { acts_as_role_restricted_options }
|
29
31
|
|
30
32
|
validates :roles_mask, numericality: true, allow_nil: true
|
31
33
|
|
32
|
-
validate(if: -> { changes.include?(:roles_mask) && EffectiveRoles.assignable_roles_present?(self) && current_user.present? }) do
|
34
|
+
validate(if: -> { changes.include?(:roles_mask) && EffectiveRoles.assignable_roles_present?(self) && current_user.present? }, unless: -> { skip_effective_roles_validation }) do
|
33
35
|
roles_was = EffectiveRoles.roles_for(changes[:roles_mask].first)
|
34
36
|
changed = (roles + roles_was) - (roles & roles_was) # XOR
|
35
37
|
|
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.7.
|
4
|
+
version: 2.7.1
|
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: 2024-04-
|
11
|
+
date: 2024-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|