Clarify permission "HasAccess" behavior (#30585)
Follow #30495 "HasAccess" behavior wasn't clear, to make it clear: * Use a new name `HasAnyUnitAccess`, it will be easier to review related code and permission problems. * Separate everyone access mode to a separate field, then all calls to HasAccess are reverted to old behavior before #30495. * Add new tests. --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@ -585,7 +585,7 @@ func GetByID(ctx *context.APIContext) {
|
||||
if err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "GetUserRepoPermission", err)
|
||||
return
|
||||
} else if !permission.HasAccess() {
|
||||
} else if !permission.HasAnyUnitAccess() {
|
||||
ctx.NotFound()
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user