lato_core 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2bba9533c6d8ca36fccc5d5c43cf5253221c58b2
|
|
4
|
+
data.tar.gz: b778ebd736a83e911c7f44f5fb4737b71a523533
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 54971b4d53cbfe95c08fdd91e26406957880008b831d162f445c4950464b0ba3da2e16697e35833b024d2848259eff8fe17982a8643a9e018346173288f3d3b1
|
|
7
|
+
data.tar.gz: 0c7ea56aff524d2ec57c07e8075b8d2d762563e0c51cbbbd0c2252bde4c6b0a185693823864de9047bc53c637960ef854f7f44cc0b856242c3b958fe3654c44f
|
data/config/configs.yml
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
module LatoCore
|
|
2
4
|
|
|
3
5
|
# This module contains a list of functions used to authenticate a superuser.
|
|
@@ -23,7 +25,7 @@ module LatoCore
|
|
|
23
25
|
|
|
24
26
|
# This function check the session for a superuser and set the variable @core__current_superuser.
|
|
25
27
|
# If session is not valid the user should be redirect to login path.
|
|
26
|
-
def core__manage_superuser_session
|
|
28
|
+
def core__manage_superuser_session(permission = nil)
|
|
27
29
|
decoded_token = core__decode_token(session[:lato_core__superuser_session_token])
|
|
28
30
|
|
|
29
31
|
if decoded_token
|
|
@@ -32,10 +34,15 @@ module LatoCore
|
|
|
32
34
|
core__destroy_superuser_session
|
|
33
35
|
redirect_to lato_core.login_path
|
|
34
36
|
end
|
|
37
|
+
|
|
38
|
+
if permission && @core__current_superuser.permission < permission
|
|
39
|
+
flash[:danger] = 'PERMISSION ERROR'
|
|
40
|
+
redirect_to lato_core.root_path
|
|
41
|
+
end
|
|
35
42
|
else
|
|
36
43
|
redirect_to lato_core.login_path
|
|
37
44
|
end
|
|
38
45
|
end
|
|
39
46
|
|
|
40
47
|
end
|
|
41
|
-
end
|
|
48
|
+
end
|
data/lib/lato_core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lato_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ideonetwork
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-11-
|
|
11
|
+
date: 2017-11-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|