summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-26 10:36:25 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-04-27 17:24:08 +0200
commit57da4f4efa0b8b7d96b1238b0127aa83d20007eb (patch)
tree6d3185e571231b923aa7d020dc5224a3a246c374 /ogcp/views.py
parentc7b0024d2405d29e5c36445b6d28af046b2213f1 (diff)
Add user role administrator
ogCP now have to types of users, regular and administrator users. ogCP configuration file defines users roles with the boolean field "ADMIN".
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 66e9007..d1e4109 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -210,7 +210,7 @@ def load_user(username):
if not user_dict:
return None
- user = User(username, user_dict.get('SCOPES'))
+ user = User(username, user_dict.get('SCOPES'), user_dict.get('ADMIN'))
return user
@app.before_request
@@ -265,7 +265,7 @@ def login():
user_dict = authenticate_user(form_user, pwd)
if not user_dict:
return render_template('auth/login.html', form=form)
- user = User(form_user, user_dict.get('SCOPES'))
+ user = User(form_user, user_dict.get('SCOPES'), user_dict.get('ADMIN'))
login_user(user)
return redirect(url_for('index'))
return render_template('auth/login.html', form=LoginForm())