diff options
author | 赵智超 <1012112796@qq.com> | 2020-06-07 05:43:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-06 17:43:01 -0400 |
commit | 821570c0b08590ec9c28c787b3eb66b601caeab0 (patch) | |
tree | 051949e8527dad831dae74df7474658d2de8336b /templates/repo/diff | |
parent | 287e2c781b5966befdf6d7c6db80bae648fe3199 (diff) | |
download | gitea-821570c0b08590ec9c28c787b3eb66b601caeab0.tar.gz gitea-821570c0b08590ec9c28c787b3eb66b601caeab0.zip |
Fix to allow comment poster to edit or delete his own comments (#11671) (#11774)
* bug: fix comment update permision check
No the ui only allow poster to update or delet comment, which
is not reasonable and different with handle logic, this pr
change it to allow poster of comment do it
ref code:
https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1636
https://github.com/go-gitea/gitea/blob/e8955173a9be1acaa9a3755c37b6059422acda20/routers/repo/issue.go#L1681
fix #11663
Signed-off-by: a1012112796 <1012112796@qq.com>
* simplify code
* fix sign in
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'templates/repo/diff')
-rw-r--r-- | templates/repo/diff/comments.tmpl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 288b2316a6..097d437a6d 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -31,7 +31,7 @@ {{end}} {{end}} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }} - {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true }} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true "IsCommentPoster" (and $.root.IsSigned (eq $.root.SignedUserID .PosterID))}} </div> </div> <div class="ui attached segment"> |