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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e17eb8ad5fd168be1fc8a40908d613466f05df2cf724ad2989e8eb0ea98068b0
4
- data.tar.gz: 42ab1e2a10d6c279139e034ecefbdc1b60e36ed8de464904d4f0fb067650c971
3
+ metadata.gz: 9dc0e6f33ade1b7263f4804869691932b40412a7be67252e079aa9e85e8a2e69
4
+ data.tar.gz: ca833df2913ce7d842f125d07bc685b28b74f349c1016b5169a3946ab1e8d0ee
5
5
  SHA512:
6
- metadata.gz: 7b8b712c799ce127b6ec8e2d3a5f95e8b2d79a36c693f846263dc18f0faf256cadc0c92a792dee8e15b054a1beb77c49f8d62ec3438187f1b82efbed9507b784
7
- data.tar.gz: 901a12fb2c742deb2f17d3dab4082e8bdeab288101d34a1434ad68dc16d860e456c325567345374494a6f2930a022d7c1c58ec7c9771fe29b313eaaa1d701621
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: actions.map(&:to_s)
54
- ).and_return(mocked_permissions)
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: other_resource_actions
63
- ).and_return([])
61
+ action: actions.map(&:to_s)
62
+ ).and_return(mocked_permissions)
64
63
 
65
- # PERMISSIONS missing for scoped access
64
+ # missing for scoped access
66
65
  allow(Ez::Permissions::Permission).to receive(:where).with(
67
66
  id: [],
68
67
  resource: resource,
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ez
4
4
  module Permissions
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ez-permissions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Sveredyuk