Commit a499689c by Kálmán Viktor

dashboard: groupless users can see their own email

parent 5a55ce9d
...@@ -27,11 +27,8 @@ ...@@ -27,11 +27,8 @@
<p>{% trans "First name" %}: {{ profile.first_name|default:"-" }}</p> <p>{% trans "First name" %}: {{ profile.first_name|default:"-" }}</p>
<p>{% trans "Last name" %}: {{ profile.last_name|default:"-" }}</p> <p>{% trans "Last name" %}: {{ profile.last_name|default:"-" }}</p>
<p> <p>
{# if the group list is not empty the logged in user is somewhat related to the user #} {% if perm_email %}
{% if perm_group_list %}
{% trans "Email address" %}: {{ profile.email }} {% trans "Email address" %}: {{ profile.email }}
{% else %}
-
{% endif %} {% endif %}
</p> </p>
{% if request.user == profile %} {% if request.user == profile %}
......
...@@ -2720,6 +2720,8 @@ class ProfileView(LoginRequiredMixin, DetailView): ...@@ -2720,6 +2720,8 @@ class ProfileView(LoginRequiredMixin, DetailView):
# to any of the groups the user belongs to # to any of the groups the user belongs to
context['perm_group_list'] = ( context['perm_group_list'] = (
self.request.user.is_superuser or len(context['groups']) > 0) self.request.user.is_superuser or len(context['groups']) > 0)
context['perm_email'] = (
context['perm_group_list'] or self.request.user == user)
# filter the virtual machine list # filter the virtual machine list
# if the logged in user is not superuser or not the user itself # if the logged in user is not superuser or not the user itself
......
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 sign in to comment