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: 0b3cb619704ea0d8331e05ff5766ec50e52b9fd1b071f3b0c57e0381e74fe392
4
- data.tar.gz: 49ec9488c36cfb014a3064056820d5de09022b09f998953d4a9611e750ca192a
3
+ metadata.gz: b4c111c5d9e2a8c1838b3a9fcb5d28496c6a198ffbef309d15aca86156e5e645
4
+ data.tar.gz: 76c4ef4bead54b12e40a09e12f4127e25093cf2974a175a73d695715f5155983
5
5
  SHA512:
6
- metadata.gz: a72abb0e7ba2e23073044950f0008e407aa4b3326d1683ffa7d4cdf2ce209013deac6c2fb408f52a338a331992e6be0a350963806ee6a8cc5cef12545ca6e2e1
7
- data.tar.gz: e8db52f1b8687bc2464f80dc2467e209eb6d4bb080bcf2f675835372395699aadd39232bf9eae194ddc2a5e5f6cecec42fae31f7cb0642d7b0fd065a94653000
6
+ metadata.gz: 62cac043782c924d2322504eabdd5308af472bf5e12420117628fc73f02f5429d33cac4b126672b8d7e939c7cfe7b4720ec7e88015382e3d098e236e5c7fb0ca
7
+ data.tar.gz: b6b7eb1f51ab6d101d4c78106a603aa469d3ce5ce822840c775717b05675c7a3d2436e62bab2ae9e4e43053be4f05686703c502d5304b793dcffb5fc26475fd8
@@ -1,12 +1,16 @@
1
1
  module Mumukit::Login::AuthorizationHelpers
2
- def authorize!(role)
2
+ def authorize_for!(role, slug)
3
3
  if current_user?
4
- current_user.protect! role, authorization_slug
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
@@ -1,5 +1,5 @@
1
1
  module Mumukit
2
2
  module Login
3
- VERSION = '5.0.1'
3
+ VERSION = '5.1.0'
4
4
  end
5
5
  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.1
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-03-29 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler