permission_policy 0.1.2 → 0.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1e6ec5b93dd0bc7ca5497b8b6782fc7e6e418d2
|
4
|
+
data.tar.gz: f7030682a9d3730b6bd5aa66baa9103d14ae28d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3d55e847954f0cd5cd854c0280e326842070ef52269ec6d7838eadb7a198d6241669df60a21e1f0cbb5c5510cbaf106f26847b1d1cd3df2fb98ac110cd367e4
|
7
|
+
data.tar.gz: 2ac77c16affac60d940a325af8244d8f35109662db81411918b740cec0e78892c398f1acd97d9f82e8d942a03864d2532be96f834805c8b7fba91abe49342f81
|
data/CHANGELOG.md
CHANGED
@@ -17,7 +17,7 @@ module PermissionPolicy
|
|
17
17
|
def initialize(authorization, action = nil, options = {})
|
18
18
|
authorization.preconditions.each do |attribute|
|
19
19
|
self.class.send(:attr_accessor, attribute)
|
20
|
-
instance_variable_set(:"@#{attribute}", authorization.public_send(attribute))
|
20
|
+
instance_variable_set(:"@#{attribute}", authorization.context.public_send(attribute))
|
21
21
|
end
|
22
22
|
|
23
23
|
self.action = action
|
@@ -3,7 +3,8 @@ module PermissionPolicy
|
|
3
3
|
RSpec.describe BaseStrategy do
|
4
4
|
|
5
5
|
context 'valid' do
|
6
|
-
let(:
|
6
|
+
let(:context) { double('context', current_user: 'me') }
|
7
|
+
let(:authorization) { double('authorization', preconditions: [:current_user], context: context) }
|
7
8
|
let(:action) { :foo }
|
8
9
|
let(:options) { { something: 'nice' } }
|
9
10
|
|
@@ -24,4 +25,4 @@ module PermissionPolicy
|
|
24
25
|
|
25
26
|
end
|
26
27
|
end
|
27
|
-
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: permission_policy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marco Schaden
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|