mumukit-auth 3.5.0 → 3.5.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: 63256ef255aa98c721f6ae19e80175d854a95b1f
4
- data.tar.gz: 2363ef922d76cc6be39fca46a586cc034d3e3968
3
+ metadata.gz: 75c9b0fd1c258c727eb548b526c37282bd3b02e3
4
+ data.tar.gz: 6830844a86fac1e59678f84b814ace97f7bfb0f9
5
5
  SHA512:
6
- metadata.gz: b5c80f78f868f61cbd86b9e7fe2b7c015cbbbc1e90354f74ea630d920fce964255b2b0fc00b5992da25ae2eec237f5a0a53fe8b95b575d0dad61a4155bc3f07e
7
- data.tar.gz: 36fde21860e81bf850740361ea5825bf005e49dff2dbca0620859d645be18ad5bff86f75d87d4a36b3b3150fbb6813739a2beff9d622a2b6751a98cae35639ac
6
+ metadata.gz: d73b1ca5ff76c981f7e981a40475fe49be8a21a9bc11775a752d5c5d3e494301003bd3f8605ded35bd7db3475bbc7e10532d3c89b6466fb13135452f39d337ca
7
+ data.tar.gz: 4904a2cb5e5cf1050582010c62332299946a0adc2c9eec1721344eb52719e06156704231dc450f84a5eef39ad67f3979bd650ec9e706fd8963c3d19fe6d11d67
@@ -3,8 +3,5 @@ module Mumukit::Auth
3
3
  end
4
4
 
5
5
  class UnauthorizedAccessError < StandardError
6
- def self.with_message(slug, grants)
7
- new "Unauthorized access to #{slug}. Permissions are #{grants}"
8
- end
9
6
  end
10
7
  end
@@ -18,7 +18,8 @@ class Mumukit::Auth::Permissions
18
18
  end
19
19
 
20
20
  def protect!(role, slug)
21
- raise Mumukit::Auth::UnauthorizedAccessError.with_message(slug, scope_for(role)) unless has_permission?(role, slug)
21
+ raise Mumukit::Auth::UnauthorizedAccessError,
22
+ "Unauthorized access to #{slug} as #{role}. Scope is `#{scope_for role}`" unless has_permission?(role, slug)
22
23
  end
23
24
 
24
25
  def has_role?(role)
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Auth
3
- VERSION = '3.5.0'
3
+ VERSION = '3.5.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.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Leonardo Bulgarelli