summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2017-12-28 19:16:12 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2017-12-28 19:16:12 +0100
commite94ac60ec21a15fc19c19a587c51ed8999150384 (patch)
treec60a31b835eb177dc3881d8b2b0587faed33bf0f
parentec3a4cf0a02bb5c9b396081258aa9d4b9c26ae04 (diff)
downloadarchweb-e94ac60ec21a15fc19c19a587c51ed8999150384.tar.gz
archweb-e94ac60ec21a15fc19c19a587c51ed8999150384.zip
Require mirror.change_mirror perm to see emails
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
-rw-r--r--mirrors/views/api.py2
-rw-r--r--templates/mirrors/mirror_details.html2
2 files changed, 3 insertions, 1 deletions
diff --git a/mirrors/views/api.py b/mirrors/views/api.py
index db80080f..a04c93f3 100644
--- a/mirrors/views/api.py
+++ b/mirrors/views/api.py
@@ -92,7 +92,7 @@ def mirror_details_json(request, name):
show_all=authorized)
data = status_info.copy()
data['version'] = 3
- if authorized:
+ if authorized and request.user.has_perm('mirror.change_mirror'):
data['admin_email'] = mirror.admin_email
data['alternate_email'] = mirror.alternate_email
to_json = json.dumps(data, ensure_ascii=False,
diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html
index 401a57e7..40e76190 100644
--- a/templates/mirrors/mirror_details.html
+++ b/templates/mirrors/mirror_details.html
@@ -53,6 +53,7 @@
<th>Rsync IPs:</th>
<td class="wrap">{{mirror.rsync_ips.all|join:', '}}</td>
</tr>
+ {% if perms.mirrors.change_mirror %}
<tr>
<th>Admin Email:</th>
<td>{% if mirror.admin_email %}<a href="mailto:{{ mirror.admin_email }}">{{ mirror.admin_email }}</a>{% else %}None{% endif %}</td>
@@ -61,6 +62,7 @@
<th>Alternate Email:</th>
<td>{% if mirror.alternate_email %}<a href="mailto:{{ mirror.alternate_email }}">{{ mirror.alternate_email }}</a>{% else %}None{% endif %}</td>
</tr>
+ {% endif %}
<tr>
<th>Flyspray Issue:</th>
<td>{% if mirror.bug %}<a href="https://bugs.archlinux.org/task/{{ mirror.bug }}">FS#{{ mirror.bug }}</a>{% endif %}</td>