mumukit-login 5.0.1 → 5.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4c111c5d9e2a8c1838b3a9fcb5d28496c6a198ffbef309d15aca86156e5e645
|
4
|
+
data.tar.gz: 76c4ef4bead54b12e40a09e12f4127e25093cf2974a175a73d695715f5155983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62cac043782c924d2322504eabdd5308af472bf5e12420117628fc73f02f5429d33cac4b126672b8d7e939c7cfe7b4720ec7e88015382e3d098e236e5c7fb0ca
|
7
|
+
data.tar.gz: b6b7eb1f51ab6d101d4c78106a603aa469d3ce5ce822840c775717b05675c7a3d2436e62bab2ae9e4e43053be4f05686703c502d5304b793dcffb5fc26475fd8
|
@@ -1,12 +1,16 @@
|
|
1
1
|
module Mumukit::Login::AuthorizationHelpers
|
2
|
-
def
|
2
|
+
def authorize_for!(role, slug)
|
3
3
|
if current_user?
|
4
|
-
current_user.protect! role,
|
4
|
+
current_user.protect! role, slug
|
5
5
|
else
|
6
6
|
authenticate!
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
10
|
+
def authorize!(role)
|
11
|
+
authorize_for!(role, authorization_slug)
|
12
|
+
end
|
13
|
+
|
10
14
|
def has_permission?(role)
|
11
15
|
current_user.has_permission? role, authorization_slug
|
12
16
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mumukit-login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Franco Leonardo Bulgarelli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|