Commit 73a8ed64 authored by Daniele Venzano's avatar Daniele Venzano

Fix gitlab email error message and show only enables capabilities

parent b5a3a6a5
......@@ -22,6 +22,7 @@ import requests
import tornado.escape
from zoe_api.rest_api.request_handler import ZoeAPIRequestHandler
from zoe_api.web.request_handler import ZoeWebRequestHandler
from zoe_api.exceptions import ZoeException
from zoe_api.auth.requests_oauth2 import EurecomGitLabClient
......@@ -153,7 +154,7 @@ class UserCollectionAPI(ZoeAPIRequestHandler):
self.write({'user_id': new_id})
class UserOAuthCallbackAPI(ZoeAPIRequestHandler):
class UserOAuthCallbackAPI(ZoeWebRequestHandler):
"""The User OAUTH callback endpoint."""
def get(self):
"""Callback."""
......@@ -173,7 +174,7 @@ class UserOAuthCallbackAPI(ZoeAPIRequestHandler):
email = data['email']
except KeyError:
with_gitlab_oauth = zoe_lib.config.get_conf().oauth_client_id != ''
self.render('login.jinja2', error='Email address not set to public in GitLab settings', with_gitlab_oauth=with_gitlab_oauth)
self.render('login.jinja2', error='No public email address set in GitLab settings', with_gitlab_oauth=with_gitlab_oauth)
return
username = data['nickname']
user = self.api_endpoint.user_by_name(username)
......
......@@ -116,13 +116,27 @@
<h3>Role details</h3>
<ul>
<li>Your role is: {{ user.role.name }}</li>
<li>Can access status page: {{ user.role.can_see_status }}</li>
<li>Can change Zoe configuration: {{ user.role.can_change_config }}</li>
<li>Can operate on other users: {{ user.role.can_operate_others }}</li>
<li>Can delete executions: {{ user.role.can_delete_executions }}</li>
<li>Can access the API: {{ user.role.can_access_api }}</li>
<li>Can customize ZApp resource reservations: {{ user.role.can_customize_resources }}</li>
<li>Can access the full ZApp shop: {{ user.role.can_access_full_zapp_shop }}</li>
{% if user.role.can_see_status %}
<li>You can access the status page</li>
{% endif %}
{% if user.role.can_change_config %}
<li>You can change Zoe configuration</li>
{% endif %}
{% if user.role.can_operate_others %}
<li>You can operate on other users</li>
{% endif %}
{% if user.role.can_delete_executions %}
<li>You can delete executions</li>
{% endif %}
{% if user.role.can_access_api %}
<li>You can access the API</li>
{% endif %}
{% if user.role.can_customize_resources %}
<li>You can customize ZApp resource reservations</li>
{% endif %}
{% if user.role.can_access_full_zapp_shop %}
<li>You can access the full ZApp shop</li>
{% endif %}
</ul>
{% endblock %}
{% extends "base.jinja2" %}
{% block title %}Login{% endblock %}
{% block title %}
Login
{% endblock %}
{% block custom_head %}
<script src="{{ static_url("jquery.validate.min.js") }}" type="application/javascript"></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment