role_core 0.0.29 → 0.0.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/role_core/contrib/can_can_can_permission.rb +5 -2
- data/lib/role_core/version.rb +1 -1
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1080fa1afb5395d4570e31270ad56cd59fc637a4f008590b986219254c2ba600
|
4
|
+
data.tar.gz: 28e499fa5ef2c154c29f2df63629e9c5c5bc771b21299d761e77a4f0f9af7bb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 785e0ea6e99a8bcb5f0814074ea6ac8e7dac6ce0f4bb2b1193e1c673ea00e65b9bd7efefc646cdcf7e5395f5f48654ac49ef8a942dcd6c32106c5032f4ce9c33
|
7
|
+
data.tar.gz: fa735cac88ed8b1084e3f0ae79bffdeb81ffe59f25752de3bea81a56b11d899fef21be06f35759635514de49cdc1f845bcfb15950468aba43654378476ba1f2a
|
@@ -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,13 @@
|
|
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.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jasl
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-08 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: options_model
|
@@ -31,7 +30,7 @@ dependencies:
|
|
31
30
|
- !ruby/object:Gem::Version
|
32
31
|
version: '1.0'
|
33
32
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
33
|
+
name: activerecord
|
35
34
|
requirement: !ruby/object:Gem::Requirement
|
36
35
|
requirements:
|
37
36
|
- - ">="
|
@@ -39,7 +38,7 @@ dependencies:
|
|
39
38
|
version: '5'
|
40
39
|
- - "<"
|
41
40
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
41
|
+
version: '9'
|
43
42
|
type: :runtime
|
44
43
|
prerelease: false
|
45
44
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,7 +48,7 @@ dependencies:
|
|
49
48
|
version: '5'
|
50
49
|
- - "<"
|
51
50
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
51
|
+
version: '9'
|
53
52
|
description: RoleCore is a Rails engine which could provide essential industry of
|
54
53
|
Role-based access control.
|
55
54
|
email:
|
@@ -85,7 +84,6 @@ homepage: https://github.com/rails-engine/role_core
|
|
85
84
|
licenses:
|
86
85
|
- MIT
|
87
86
|
metadata: {}
|
88
|
-
post_install_message:
|
89
87
|
rdoc_options: []
|
90
88
|
require_paths:
|
91
89
|
- lib
|
@@ -100,8 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
98
|
- !ruby/object:Gem::Version
|
101
99
|
version: '0'
|
102
100
|
requirements: []
|
103
|
-
rubygems_version: 3.
|
104
|
-
signing_key:
|
101
|
+
rubygems_version: 3.6.3
|
105
102
|
specification_version: 4
|
106
103
|
summary: RoleCore is a Rails engine which could provide essential industry of Role-based
|
107
104
|
access control.
|