ez-permissions 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ez/permissions/rspec_helpers.rb +7 -8
- data/lib/ez/permissions/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dc0e6f33ade1b7263f4804869691932b40412a7be67252e079aa9e85e8a2e69
|
4
|
+
data.tar.gz: ca833df2913ce7d842f125d07bc685b28b74f349c1016b5169a3946ab1e8d0ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c4aed6394c86da052b307eccc2dc76c9fa89e53a66661a557ee8e5f01b36c2a273c990fdbfc2adea2bd7d39457a34f74b27ada0861edd52cb8ea805963137b0
|
7
|
+
data.tar.gz: d2edf56f4dcfbf2f7dabf9b6bf65ca9b535c3655e6cd9e1638e5e7f84916c08153baca23a3751d2d848fef348069acd30083edf586a2f026e93a47f9ce389525
|
@@ -47,22 +47,21 @@ module Ez
|
|
47
47
|
allow(mocked_empty_permission_role).to receive(:pluck).with(:permission_id).and_return([])
|
48
48
|
|
49
49
|
# PERMISSIONS
|
50
|
+
# missing for all other actions
|
50
51
|
allow(Ez::Permissions::Permission).to receive(:where).with(
|
51
52
|
id: mocked_permissions.map(&:id),
|
52
53
|
resource: resource,
|
53
|
-
action:
|
54
|
-
).and_return(
|
55
|
-
|
56
|
-
# PERMISSIONS missing for all other actions
|
57
|
-
other_resource_actions = Ez::Permissions::DSL.resource(resource).actions.reject { |a| actions.include?(a) }.map(&:to_s)
|
54
|
+
action: anything
|
55
|
+
).and_return([])
|
58
56
|
|
57
|
+
# present only for current actions
|
59
58
|
allow(Ez::Permissions::Permission).to receive(:where).with(
|
60
59
|
id: mocked_permissions.map(&:id),
|
61
60
|
resource: resource,
|
62
|
-
action:
|
63
|
-
).and_return(
|
61
|
+
action: actions.map(&:to_s)
|
62
|
+
).and_return(mocked_permissions)
|
64
63
|
|
65
|
-
#
|
64
|
+
# missing for scoped access
|
66
65
|
allow(Ez::Permissions::Permission).to receive(:where).with(
|
67
66
|
id: [],
|
68
67
|
resource: resource,
|