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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6dc7cde74c8d2be8dda211f8a32990f3a2ef4296aed80b7f1b567e3c2b31d150
|
4
|
+
data.tar.gz: 3ae54beebd8970966fbd0ee00ede0d531b1419b7870e09f03f57fedb361813e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f409bb6273e7f8f499f065ab0a2e886f0338a9bf6c9690d058f58b0b331d828b272213132f2cd0956616414c3ecd4fb2419b1f36837bb4f9a5379d1ab818250f
|
7
|
+
data.tar.gz: 6a9c2821af7cf2d378905a1c25110e3aae79d4c41c7c4430846b2c1b2ebbadbc9e7cdb76ce3d578bc5c35c376cd79245ff622654eb0970dd7aa47f3d8b6c4fc0
|
@@ -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
|
-
@
|
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
|
data/lib/role_core/version.rb
CHANGED
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.
|
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:
|
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:
|
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.
|
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
|