mirror of
https://github.com/go-gitea/gitea
synced 2024-08-19 13:50:42 +02:00
Fix bug when read public repo lfs file (#5912)
* fix bug when read public repo lfs file * add comment on lfs permission check
This commit is contained in:
parent
0823791d17
commit
bbad9b6178
@ -497,12 +497,15 @@ func authenticate(ctx *context.Context, repository *models.Repository, authoriza
|
|||||||
accessMode = models.AccessModeWrite
|
accessMode = models.AccessModeWrite
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ctx.IsSigned is unnecessary here, this will be checked in perm.CanAccess
|
||||||
perm, err := models.GetUserRepoPermission(repository, ctx.User)
|
perm, err := models.GetUserRepoPermission(repository, ctx.User)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if ctx.IsSigned {
|
|
||||||
return perm.CanAccess(accessMode, models.UnitTypeCode)
|
canRead := perm.CanAccess(accessMode, models.UnitTypeCode)
|
||||||
|
if canRead {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
user, repo, opStr, err := parseToken(authorization)
|
user, repo, opStr, err := parseToken(authorization)
|
||||||
|
Loading…
Reference in New Issue
Block a user