cannie 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cannie/permissions.rb +2 -1
- data/lib/cannie/version.rb +1 -1
- data/spec/cannie/permissions_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b0f6d3ffeedaeacc9c4ae11762c861d74b664e
|
4
|
+
data.tar.gz: 18f5003cc7ecaabd9e43fbedc23c9350e0e5921e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf7e901d46c51c7e698fece777cf9e57c8730e2716fc60f0fb9c518bddcd3814a11905b28b96fec97ead5a26ff48fa7bf64283a6e1cd982213071526fe2f5362
|
7
|
+
data.tar.gz: 00e301a82871ea5b5e668cc15b96c43e7af58e97cc45825bfd95e68a1344662bfce97d60b4f22425c33ba0dace67753564b33f7b9fb236e24b6b4ecac51dab09
|
data/lib/cannie/permissions.rb
CHANGED
data/lib/cannie/version.rb
CHANGED
@@ -46,6 +46,11 @@ describe Cannie::Permissions do
|
|
46
46
|
|
47
47
|
let(:permissions) { subject.new }
|
48
48
|
|
49
|
+
it 'returns false if no rules for action exists' do
|
50
|
+
permissions.stub(:rules).and_return([])
|
51
|
+
expect(permissions.can? :read, on: [2, 4, 8]).to be_false
|
52
|
+
end
|
53
|
+
|
49
54
|
it 'returns true if all rules for action & subject are permitted' do
|
50
55
|
expect(permissions.can? :read, on: [2, 4, 8]).to be_true
|
51
56
|
end
|