Skip to content

Commit 72d0f5f

Browse files
committed
Simplify permission checks
1 parent fd27108 commit 72d0f5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

models/action.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,8 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
490490
refMarked[key] = true
491491

492492
// FIXME: this kind of condition is all over the code, it should be consolidated in a single place
493-
canclose := perm.IsAdmin() || perm.IsOwner() || perm.CanWrite(UnitTypeIssues) || refIssue.PosterID == doer.ID
494-
cancomment := canclose || perm.CanRead(UnitTypeIssues)
493+
canclose := perm.CanWrite(UnitTypeIssues) || refIssue.PosterID == doer.ID
494+
cancomment := perm.CanRead(UnitTypeIssues)
495495

496496
// Don't proceed if the user can't comment
497497
if !cancomment {

0 commit comments

Comments
 (0)