papers_please 0.0.2.beta → 0.0.3.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/papers_please/policy.rb +2 -2
- data/lib/papers_please/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: dfc4c5fd0a8edd23d0befb5b369c2c87247927230893534ddd338d504eccf72f
|
4
|
+
data.tar.gz: aa89dd7a72410900567bbd3b44f7ea7cd57abd44821d478499310fd8b99b7cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a427adc6461f8d3e3641afcb1778e737811404bac92dd5637d621c88c9dc7c3d4b52d4fd745d9272fc5e5a2848a2e8c24c2302527921bf4e5013ad9acdf14cfb
|
7
|
+
data.tar.gz: ae00489c552cf58bfaa20555fcde4e0d84b9356b8d835d2e9d015bcfd683afce7f57dcb2f1880d801137f1aab443e2dbdca39938cc4907b42224b991d0623a23
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ A roles and permissions gem from Apsis Labs.
|
|
9
9
|
```ruby
|
10
10
|
# app/policies/access_policy.rb
|
11
11
|
class AccessPolicy < PapersPlease::Policy
|
12
|
-
|
12
|
+
def configure
|
13
13
|
# Define a role in a block
|
14
14
|
role :admin, (proc { |u| u.admin? }) do
|
15
15
|
grant [:manage, :archive], Post
|
data/lib/papers_please/policy.rb
CHANGED
@@ -12,7 +12,7 @@ module PapersPlease
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def configure
|
15
|
-
raise NotImplementedError
|
15
|
+
raise NotImplementedError, "The #configure method of the access policy was not implemented"
|
16
16
|
end
|
17
17
|
|
18
18
|
# Add a role to the Policy
|
@@ -43,7 +43,7 @@ module PapersPlease
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def authorize!(action, subject)
|
46
|
-
raise AccessDenied.new(action
|
46
|
+
raise AccessDenied.new("Access denied for #{action} on #{subject}") if cannot?(action, subject)
|
47
47
|
subject
|
48
48
|
end
|
49
49
|
|