forked from forgejo/forgejo
better fork permission check
This commit is contained in:
parent
9db4acc62e
commit
e3bdfd51ff
3 changed files with 15 additions and 0 deletions
|
@ -78,6 +78,12 @@ func ForkPost(ctx *middleware.Context, form auth.CreateRepoForm) {
|
|||
return
|
||||
}
|
||||
|
||||
repo, has := models.HasForkedRepo(ctxUser.Id, forkRepo.Id)
|
||||
if has {
|
||||
ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + repo.Name)
|
||||
return
|
||||
}
|
||||
|
||||
// Check ownership of organization.
|
||||
if ctxUser.IsOrganization() {
|
||||
if !ctxUser.IsOwnedBy(ctx.User.Id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue