mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 15:53:36 +01:00
parent
2c653141a8
commit
df339ad8b0
1 changed files with 10 additions and 6 deletions
|
@ -274,19 +274,23 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
mode, err := models.AccessLevel(ctx.User, repo)
|
// Admin has super access.
|
||||||
if err != nil {
|
if ctx.User.IsAdmin {
|
||||||
ctx.Handle(500, "AccessLevel", err)
|
ctx.Repo.AccessMode = models.ACCESS_MODE_OWNER
|
||||||
return
|
} else {
|
||||||
|
mode, err := models.AccessLevel(ctx.User, repo)
|
||||||
|
if err != nil {
|
||||||
|
ctx.Handle(500, "AccessLevel", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ctx.Repo.AccessMode = mode
|
||||||
}
|
}
|
||||||
ctx.Repo.AccessMode = mode
|
|
||||||
|
|
||||||
// Check access.
|
// Check access.
|
||||||
if ctx.Repo.AccessMode == models.ACCESS_MODE_NONE {
|
if ctx.Repo.AccessMode == models.ACCESS_MODE_NONE {
|
||||||
ctx.Handle(404, "no access right", err)
|
ctx.Handle(404, "no access right", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Data["HasAccess"] = true
|
ctx.Data["HasAccess"] = true
|
||||||
|
|
||||||
if repo.IsMirror {
|
if repo.IsMirror {
|
||||||
|
|
Loading…
Reference in a new issue