Skip to content

Commit f1cf75e

Browse files
committed
admin should be able to delete repos even if he is not a member of the organization (go-gitea#5443)
1 parent 7bc1faa commit f1cf75e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/api/v1/repo/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ func Delete(ctx *context.APIContext) {
508508
owner := ctx.Repo.Owner
509509
repo := ctx.Repo.Repository
510510

511-
if owner.IsOrganization() {
511+
if owner.IsOrganization() && !ctx.User.IsAdmin {
512512
isOwner, err := owner.IsOwnedBy(ctx.User.ID)
513513
if err != nil {
514514
ctx.Error(500, "IsOwnedBy", err)

0 commit comments

Comments
 (0)