unidom-authorization 1.6.1 → 1.6.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f606e2b92a57d5ec745cda441d7da33b79a484e
|
4
|
+
data.tar.gz: 96ff8f3d4af000942776552800b59ef9359ba1ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b11a0816e6003a8de6ddd30ac71c1e9bc7292e0e6dcc597b706d9044c06458135f9159d03af4662862d328af73f061efcbae3384f802ebe86fbf7678fa5a499d
|
7
|
+
data.tar.gz: 409daacaea1c2d3c8de54626a5d8945e5d131f1d2ffbd66655887f9013e230670933d30955264b089c05dd11306d58ed243a20cc6bb7695f9e5b651644e77e70
|
@@ -11,9 +11,9 @@ class Unidom::Authorization::Authorizing < Unidom::Authorization::ApplicationRec
|
|
11
11
|
belongs_to :authorizer, polymorphic: true
|
12
12
|
belongs_to :authorized, polymorphic: true
|
13
13
|
|
14
|
-
scope :permission_is, ->(permission) { where permission_id: (permission
|
15
|
-
scope :authorized_is, ->(authorized) { where authorized:
|
16
|
-
scope :authorized_by, ->(authorizer) { where authorizer:
|
14
|
+
scope :permission_is, ->(permission) { where permission_id: to_id(permission) }
|
15
|
+
scope :authorized_is, ->(authorized) { where authorized: authorized }
|
16
|
+
scope :authorized_by, ->(authorizer) { where authorizer: authorizer }
|
17
17
|
|
18
18
|
##
|
19
19
|
# 授予 authorized 权限 permission ,授权者是 authorizer ,授权时间是 opened_at。如:
|
@@ -18,7 +18,12 @@ describe Unidom::Authorization::Authorizing, type: :model do
|
|
18
18
|
|
19
19
|
it_behaves_like 'Unidom::Common::Concerns::ModelExtension', model_attributes
|
20
20
|
|
21
|
-
|
21
|
+
permission_attributes = {
|
22
|
+
name: 'User Management',
|
23
|
+
path: 'administration/users'
|
24
|
+
}
|
25
|
+
|
26
|
+
it_behaves_like 'belongs_to', model_attributes, :permission, Unidom::Authorization::Permission, permission_attributes
|
22
27
|
|
23
28
|
it_behaves_like 'scope', :permission_is, [
|
24
29
|
{ attributes_collection: [ model_attributes ], count_diff: 1, args: [ model_attributes[:permission_id] ] },
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unidom-authorization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Topbit Du
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02
|
11
|
+
date: 2017-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unidom-common
|