changeset 4835:468073f2ebd6

pullrequests: allow closing only by author and admin A pullrequest should not be closable by any reviewer, especially not since there is no reopening feature. The check on change_status is no longer necessary, as the new permission check is more restrictive.
author Thomas De Schampheleire <thomas.de_schampheleire@alcatel-lucent.com>
date Wed, 11 Feb 2015 22:13:11 +0100
parents 15cb8156b10d
children 7e78fff64709
files kallithea/templates/changeset/changeset_file_comment.html
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/templates/changeset/changeset_file_comment.html	Mon Feb 09 22:20:38 2015 +0100
+++ b/kallithea/templates/changeset/changeset_file_comment.html	Wed Feb 11 22:13:11 2015 +0100
@@ -183,9 +183,12 @@
                         <label for="${status}"><i class="icon-circle changeset-status-${status}" /></i>${lbl}</label>
                     </span>
                 %endfor
-                %if is_pr and change_status:
-                <input id="save_close" type="checkbox" name="save_close">
-                <label id="save_close_label" for="save_close">${_("Close")}</label>
+
+                %if is_pr and ( \
+                    h.HasPermissionAny('hg.admin')() or h.HasRepoPermissionAny('repository.admin')(c.repo_name) \
+                    or c.pull_request.author.user_id == c.authuser.user_id):
+                  <input id="save_close" type="checkbox" name="save_close">
+                  <label id="save_close_label" for="save_close">${_("Close")}</label>
                 %endif
               </div>
             %endif