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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff6ad1f95215dd736ce5bd90f0754ea6504a1227acaec9941fd18a7734cedd29
4
- data.tar.gz: 21ae8733e66d032ad5079bbf61877f968f2f6b036d1c69be1114500750a15cea
3
+ metadata.gz: 8c1f1f6b5dd1700dcaa93ac9b8f57ffbdd20a131be00bded8702b5f07fa65f30
4
+ data.tar.gz: c1e9fca0b2f63631519bd7a2f3cae7c5ff8ca3bb51e867a163f4f8830f511190
5
5
  SHA512:
6
- metadata.gz: ab959b54a62a9d139532fba9051e49dcbc0b614dcb6421ca856377544c2a36bf085438f8df56d1179a3b2b948d90cfdbb73fea29f806e341df474792178e1565
7
- data.tar.gz: 675002338facfd196544a287588d2693ff617afddd506ea9b04122128edc34f2af3f087331d2fcff689f41a762c0522f1ce859bcb7915c053dad4b48c638faa6
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
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveRoles
2
- VERSION = '2.7.0'.freeze
2
+ VERSION = '2.7.1'.freeze
3
3
  end
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.0
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-15 00:00:00.000000000 Z
11
+ date: 2024-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails