mumukit-auth 6.0.1 → 6.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumukit/auth/permissions.rb +5 -1
- data/lib/mumukit/auth/version.rb +1 -1
- 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: 90185e234cad2a9b0c424928ca52c8b6632989ce
|
4
|
+
data.tar.gz: 43cc37a82b5491c561ed292876df1e9bf0dc9fdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6b3bbd7e5d29cc1d0b3fb3ef107739bf399501db4391db4b7a9576e080e945cfa6201806e748ecaa4b8434913e2a0b1ce712bbc0e976ecab628c0899de1dfce
|
7
|
+
data.tar.gz: 3b2e87117579c75840993b0fbc65f47db7791e876fe7fe0a7aaa14ba6aa23fa45eb4de7f62f235d61c131031261ecb9b9503758b91f3dee899304c79ce31e9c4
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Mumukit::Auth::Permissions
|
2
2
|
include Mumukit::Auth::Roles
|
3
3
|
|
4
|
+
delegate :empty?, to: :scopes
|
5
|
+
|
4
6
|
attr_accessor :scopes
|
5
7
|
|
6
8
|
def initialize(scopes={})
|
@@ -35,7 +37,7 @@ class Mumukit::Auth::Permissions
|
|
35
37
|
end
|
36
38
|
|
37
39
|
def merge(other)
|
38
|
-
self.class.new(scopes.merge(other.scopes) { |_key, left, right| left.merge right})
|
40
|
+
self.class.new(scopes.merge(other.scopes) { |_key, left, right| left.merge right })
|
39
41
|
end
|
40
42
|
|
41
43
|
def remove_permission!(role, grant)
|
@@ -60,6 +62,8 @@ class Mumukit::Auth::Permissions
|
|
60
62
|
end
|
61
63
|
|
62
64
|
def self.parse(hash)
|
65
|
+
return new if hash.blank?
|
66
|
+
|
63
67
|
new(Hash[hash.map { |role, grants| [role, Mumukit::Auth::Scope.parse(grants)] }])
|
64
68
|
end
|
65
69
|
|
data/lib/mumukit/auth/version.rb
CHANGED