Skip to content

Commit c1275e2

Browse files
adelowolafriks
authored andcommitted
Admin should be able to delete repos even if he is not a member of the organization (#5443) (#5447)
1 parent 7bc1faa commit c1275e2

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)