mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
better fork permission check
This commit is contained in:
1 parent
9db4acc62e
commit
e3bdfd51ff
3 files changed
+15
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user