Commit a499689c by Kálmán Viktor

dashboard: groupless users can see their own email

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