crewd_policies 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/crewd_policies/jsonapi_resources.rb +5 -3
- data/lib/crewd_policies/policy.rb +4 -0
- data/lib/crewd_policies/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1faadaf0ead8b222055bd12352c9a9e60b37b1c
|
4
|
+
data.tar.gz: 32d9daabec143d2762d0c94d465190f1c68e9820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3747e925434b48677568789ed8c4275863d2f7e88d2ad11f967a93db2295d1dcd538bf8a96f8bb8fd0723690a1f6eaa4cd04e56a59b5308882f5035315ec5347
|
7
|
+
data.tar.gz: bdb2da59bb045ff010ea957b174fd6d840c252983ebb689ca5dc9c173a27a06707761da45e44ff6c0fea34156c20a12d4fb5cd19d84b6c150030ff7a64074e19
|
@@ -24,11 +24,13 @@ module CrewdPolicies
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def updatable_fields(context)
|
27
|
-
::Pundit.policy!(context[:user],
|
27
|
+
p = ::Pundit.policy!(context[:user],_model_class)
|
28
|
+
p.allowed_fields(:write).map(&:to_sym)
|
28
29
|
end
|
29
30
|
|
30
|
-
def
|
31
|
-
::Pundit.policy!(context[:user],
|
31
|
+
def creatable_fields(context)
|
32
|
+
p = ::Pundit.policy!(context[:user],_model_class)
|
33
|
+
p.allowed_fields(:write).map(&:to_sym)
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crewd_policies
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary McGhee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pundit
|