role_core 0.0.28 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39af11ea76fcb0c8a0ff489e44f929ed64fbdd18ae64f5f59f6768a000f8895a
4
- data.tar.gz: 4d7b1901033d603da7c7f2b6247f19f120cc18ee1ccf3dbab5045a7b2a385098
3
+ metadata.gz: 6dc7cde74c8d2be8dda211f8a32990f3a2ef4296aed80b7f1b567e3c2b31d150
4
+ data.tar.gz: 3ae54beebd8970966fbd0ee00ede0d531b1419b7870e09f03f57fedb361813e1
5
5
  SHA512:
6
- metadata.gz: 8649c664d4da57eb8665308dd58d2b1795dd619ff6b5e9be9611904b816e66ecbb28482bf25fa857e51a2b964966f655f2e9bddfb55a2c6c36a3506f86b927ab
7
- data.tar.gz: d020474094ece60f11a0a8aa350acfa97598eecd492d106799327a10942966d4287fc0ffe4792658143a7d269b7e023e130b6d478723857be273151e95ffd000
6
+ metadata.gz: f409bb6273e7f8f499f065ab0a2e886f0338a9bf6c9690d058f58b0b331d828b272213132f2cd0956616414c3ecd4fb2419b1f36837bb4f9a5379d1ab818250f
7
+ data.tar.gz: 6a9c2821af7cf2d378905a1c25110e3aae79d4c41c7c4430846b2c1b2ebbadbc9e7cdb76ce3d578bc5c35c376cd79245ff622654eb0970dd7aa47f3d8b6c4fc0
@@ -11,7 +11,7 @@ module RoleCore::Concerns
11
11
 
12
12
  delegate :computed_permissions, to: :permissions
13
13
 
14
- serialize :permissions, RoleCore.permission_set_class
14
+ serialize :permissions, coder: RoleCore.permission_set_class
15
15
  end
16
16
 
17
17
  def permissions_attributes=(value)
@@ -11,16 +11,19 @@ module RoleCore
11
11
  @model_name = options[:model_name]
12
12
  @subject = options[:subject]
13
13
  @action = options[:action] || name
14
- @options = options.except(:model, :model_name, :subject, :action, :_namespace, :_priority, :_callable)
14
+ @with_identity = options[:with]
15
+ @options = options.except(:model, :model_name, :subject, :action, :with, :_namespace, :_priority, :_callable)
15
16
  @block = block
16
17
  end
17
18
 
18
- def call(context, *args)
19
+ def call(context, user, *args)
19
20
  return unless callable
20
21
 
21
22
  subject = @subject || @model_name.constantize
22
23
  if block_attached?
23
24
  context.can @action, subject, &@block.curry[*args]
25
+ elsif @with_identity
26
+ context.can @action, subject, @options.merge(@with_identity => user)
24
27
  else
25
28
  context.can @action, subject, @options
26
29
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RoleCore
4
- VERSION = "0.0.28"
4
+ VERSION = "0.0.30"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: role_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - jasl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-20 00:00:00.000000000 Z
11
+ date: 2024-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: options_model
@@ -31,7 +31,7 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.0'
33
33
  - !ruby/object:Gem::Dependency
34
- name: rails
34
+ name: activerecord
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
@@ -100,7 +100,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  requirements: []
103
- rubygems_version: 3.3.4
103
+ rubygems_version: 3.5.7
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: RoleCore is a Rails engine which could provide essential industry of Role-based