permissions 0.1.0 → 0.1.1
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/.gitignore +2 -1
- data/README.md +2 -2
- data/lib/permissions.rb +3 -3
- 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: c88845bf01723a8da4b124f1eb64e5b2811cade6
|
4
|
+
data.tar.gz: 165fb1f1f13bf5d0f40dab90b8cb3d81dc770ebd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7041c9f6280d4e2cd3030889db760d099cbfbf171e8047038a968bbceddfe7259523350003c533d8cd5943f40cc876b6624c6ba0577b6d9ee7626e8883583635
|
7
|
+
data.tar.gz: 899a832e878f9cf1067382eb1e20b50bf6940d520de7fbb2278744d9237d38b84a995f99b42d3e7c8ab5c55e81d9dd20f9a765b83e6ea319f2b8051114024e6d
|
data/.gitignore
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
.gs/
|
1
|
+
.gs/
|
2
|
+
*.gem
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ A small library for adding permissions to an application for authorization.
|
|
20
20
|
|
21
21
|
`permissions`: Must be implemented by your application.
|
22
22
|
|
23
|
-
`authorize_for?(key, *args)` Based off the implemented permissions, calls block with args for the given key.
|
23
|
+
`authorize_for?(key, *args)` Based off the implemented permissions, calls block with self and args for the given key.
|
24
24
|
|
25
25
|
### Example
|
26
26
|
|
@@ -67,4 +67,4 @@ command = Command.new(user)
|
|
67
67
|
command.authorize?(user) # true
|
68
68
|
```
|
69
69
|
|
70
|
-
More examples can be found
|
70
|
+
More examples can be found in the tests.
|
data/lib/permissions.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
class Permissions
|
2
|
-
VERSION = '0.1.
|
2
|
+
VERSION = '0.1.1'
|
3
3
|
|
4
4
|
module Authorizable
|
5
5
|
def permissions
|
@@ -31,7 +31,7 @@ class Permissions
|
|
31
31
|
permissions.fetch(key, default).call(*args)
|
32
32
|
end
|
33
33
|
|
34
|
-
def deep_dup
|
35
|
-
Permissions.new(
|
34
|
+
def deep_dup(initial_permissions = {})
|
35
|
+
Permissions.new(initial_permissions.merge(permissions)) { default }
|
36
36
|
end
|
37
37
|
end
|