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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cad7de722471f7a3840c2f420fe03ba8cd3c7286
4
- data.tar.gz: 2f46709c7ecb1d2523884472c364169b191820e1
3
+ metadata.gz: 90185e234cad2a9b0c424928ca52c8b6632989ce
4
+ data.tar.gz: 43cc37a82b5491c561ed292876df1e9bf0dc9fdc
5
5
  SHA512:
6
- metadata.gz: 2cc66af3b03c90ec19971a2a782458c6a34d68be68693d96ed3a7321fd10b4631590b001cbb303ce9ae0d81f520938c1b24e6803046641196be0345cbf54eb0c
7
- data.tar.gz: 7a28369311817b470176f726e31dc7b392a5fa564c1aba733ea41f7e6b97b08c8cc5fa5b105491d34d10f568dfb5fb3d4925e1e14a001b203d46e3db122779de
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
 
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '6.0.1'
3
+ VERSION = '6.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumukit-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.1
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli