mumukit-auth 3.3.0 → 3.3.1

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: 8fbc5aece9f1ceef11e2f32c4e1bb84a4644031b
4
- data.tar.gz: 588bd33d6ba3f2d5e01e03242a461b67a369277e
3
+ metadata.gz: 5f23b529d6d0228743ee68860d65607de8d445a1
4
+ data.tar.gz: 9111141d9765007badb1616fb44e2d00e36b5e14
5
5
  SHA512:
6
- metadata.gz: 56728c7d40f73f4f6a8a7c35189b355b72842d44fc2ab08ccce57b4bae7eeb5e180731ccb89e3bab3529a49734c723be4b6856d931a9c2f15917385e00df7d72
7
- data.tar.gz: d6caaa9740b5ed65217ad769ffcfc6e42159454b5facfffd0250a63587f7236ddccd7d55053c7ec0393e478e19255f55873697f101eea1109cd119756fefd771
6
+ metadata.gz: bb9049221c29596a0089e3a0871897bc0f15858e78eec3462a27e91dc94cbc8d656fe047043b48851bd0fc9896d19d96d389ae3a7c298c7ddbe63c40a11ceb37
7
+ data.tar.gz: 5fbce125973ca3be818302f08ffaf8d4e6d07a503b154b8a439a860af1d4ec0e0ad53b64c474223aa4e259a6f2d840cf71ba3fa93f586d43363627ab33155493
@@ -17,8 +17,8 @@ class Mumukit::Auth::Permissions
17
17
  scope_for(role).allows?(resource_slug)
18
18
  end
19
19
 
20
- def protect!(scope, slug)
21
- scope_for(scope).protect!(slug)
20
+ def protect!(role, slug)
21
+ raise Mumukit::Auth::UnauthorizedAccessError.with_message(slug, scope_for(role)) unless has_permission?(role, slug)
22
22
  end
23
23
 
24
24
  def has_role?(role)
@@ -7,10 +7,6 @@ module Mumukit::Auth
7
7
  add_grant! *grants
8
8
  end
9
9
 
10
- def protect!(resource_slug)
11
- raise Mumukit::Auth::UnauthorizedAccessError.with_message(resource_slug, self) unless allows?(resource_slug)
12
- end
13
-
14
10
  def allows?(resource_slug)
15
11
  any_grant? { |grant| grant.allows? resource_slug }
16
12
  end
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '3.3.0'
3
+ VERSION = '3.3.1'
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: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli