Skip to content

Commit 8224f03

Browse files
jpraetlunny
andauthored
Check permission for the appropriate unit type (#14261)
* 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 <[email protected]>
1 parent d1581a4 commit 8224f03

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

routers/user/home.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ func Issues(ctx *context.Context) {
551551
ctx.ServerError("GetUserRepoPermission", fmt.Errorf("[%d]%v", repoID, err))
552552
return
553553
}
554-
if !perm.CanRead(models.UnitTypeIssues) {
555-
log.Error("User created Issues in Repository which they no longer have access to: [%d]", repoID)
554+
if !perm.CanRead(unitType) {
555+
log.Debug("User created Issues in Repository which they no longer have access to: [%d]", repoID)
556556
}
557557
}
558558
}

0 commit comments

Comments
 (0)