mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-29 09:31:11 -05:00
* Fix #6234 : Check organization visibility before everything else * Ensure that Owner is available in the Repo
This commit is contained in:
parent
b257e0456b
commit
f80caa5a8c
1 changed files with 11 additions and 0 deletions
|
@ -212,6 +212,17 @@ func RedirectToRepo(ctx *Context, redirectRepoID int64) {
|
|||
|
||||
func repoAssignment(ctx *Context, repo *models.Repository) {
|
||||
var err error
|
||||
if err = repo.GetOwner(); err != nil {
|
||||
ctx.ServerError("GetOwner", err)
|
||||
return
|
||||
}
|
||||
|
||||
if repo.Owner.IsOrganization() {
|
||||
if !models.HasOrgVisible(repo.Owner, ctx.User) {
|
||||
ctx.NotFound("HasOrgVisible", nil)
|
||||
return
|
||||
}
|
||||
}
|
||||
ctx.Repo.Permission, err = models.GetUserRepoPermission(repo, ctx.User)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetUserRepoPermission", err)
|
||||
|
|
Loading…
Reference in a new issue