diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2021-01-06 06:07:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-06 07:07:58 +0200 |
commit | 8224f03a23751fb83d4d57058925dac694e8753c (patch) | |
tree | 60d37835126b16021ecf9a150c38d979846f9116 /routers | |
parent | d1581a4563e5ed349f9f8337a1966a3fedfd5d9d (diff) | |
download | gitea-8224f03a23751fb83d4d57058925dac694e8753c.tar.gz gitea-8224f03a23751fb83d4d57058925dac694e8753c.zip |
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 <xiaolunwen@gmail.com>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/user/home.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/user/home.go b/routers/user/home.go index 952f5cdb3a..2b59b971aa 100644 --- a/routers/user/home.go +++ b/routers/user/home.go @@ -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) } } } |