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 +4 -4
- data/lib/mumukit/auth/permissions.rb +2 -2
- data/lib/mumukit/auth/scope.rb +0 -4
- 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: 5f23b529d6d0228743ee68860d65607de8d445a1
|
4
|
+
data.tar.gz: 9111141d9765007badb1616fb44e2d00e36b5e14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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!(
|
21
|
-
scope_for(
|
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)
|
data/lib/mumukit/auth/scope.rb
CHANGED
@@ -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
|
data/lib/mumukit/auth/version.rb
CHANGED