Remove unnecessary permission check

pull/36105/head
Lunny Xiao 2025-12-10 16:18:43 +07:00
parent c3c4e3c9c2
commit 220a908e5f
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 3 additions and 3 deletions

@ -1162,9 +1162,9 @@ func parseCompareInfo(ctx *context.APIContext, compareParam string) (result *par
return nil, nil
}
if !permBase.CanReadIssuesOrPulls(true) || !permBase.CanRead(unit.TypeCode) {
log.Trace("Permission Denied: User %-v cannot create/read pull requests or cannot read code in Repo %-v\nUser in baseRepo has Permissions: %-+v", ctx.Doer, baseRepo, permBase)
ctx.APIErrorNotFound("Can't read pulls or can't read UnitTypeCode")
if !permBase.CanRead(unit.TypeCode) {
log.Trace("Permission Denied: User %-v cannot read code in Repo %-v\nUser in baseRepo has Permissions: %-+v", ctx.Doer, baseRepo, permBase)
ctx.APIErrorNotFound("can't read baseRepo UnitTypeCode")
return nil, nil
}