Skip to content

Commit

Permalink
Check permission for the appropriate unit type (#14261)
Browse files Browse the repository at this point in the history
* Check permission for the appropriate unit type

Fixes false positives for "User created Issues in Repository which they no longer have access to" errors

* change log level to Debug

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
  • Loading branch information
jpraet and lunny authored Jan 6, 2021
1 parent d1581a4 commit 8224f03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routers/user/home.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,8 @@ func Issues(ctx *context.Context) {
ctx.ServerError("GetUserRepoPermission", fmt.Errorf("[%d]%v", repoID, err))
return
}
if !perm.CanRead(models.UnitTypeIssues) {
log.Error("User created Issues in Repository which they no longer have access to: [%d]", repoID)
if !perm.CanRead(unitType) {
log.Debug("User created Issues in Repository which they no longer have access to: [%d]", repoID)
}
}
}
Expand Down

0 comments on commit 8224f03

Please sign in to comment.