From 627ccafcc4852ae8d209cd3390aa376dbf7d85f5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jun 05 2015 12:53:27 +0000 Subject: Do not show the edit button if the user cannot edit the file --- diff --git a/pagure/templates/file.html b/pagure/templates/file.html index e7554ff..f806fd6 100644 --- a/pagure/templates/file.html +++ b/pagure/templates/file.html @@ -29,7 +29,7 @@
    - {% if output_type=='file' %} + {% if output_type=='file' and repo_admin %}
  • Edit
  • diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 1c4af17..e14efb4 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -392,6 +392,7 @@ def view_file(repo, identifier, filename, username=None): filename=filename, content=content, output_type=output_type, + repo_admin=is_repo_admin(repo), )