You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: secret.go
    path of file: ./repos/agola/internal/services/gateway/action
    
    the code of the file until where you have to start completion: // Copyright 2019 Sorint.lab
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed o
    
func (h *ActionHandler) DeleteSecret(ctx context.Context, parentType cstypes.ObjectKind, parentRef, name string) error {
	isVariableOwner, err := h.IsAuthUserVariableOwner(ctx, parentType, parentRef)
	if err != nil {
		return errors.Wrapf(err, "failed to determine ownership")
	}
	if !isVariableOwner {
		return util.NewAPIError(util.ErrForbidden, errors.Errorf("user not authorized"))
	}

	switch parentType {
	case cstypes.ObjectKindProjectGroup:
		h.log.Info().Msgf("deleting project group secret")
		_, err = h.configstoreClient.DeleteProjectGroupSecret(ctx, parentRef, name)
	case cstypes.ObjectKindProject:
		h.log.Info().Msgf("deleting project secret")
		_, err = h.configstoreClient.DeleteProjectSecret(ctx, parentRef, name)
	}
	if err != nil {
		return util.NewAPIError(util.KindFromRemoteError(err), errors.Wrapf(err, "failed to delete secret"))
	}
	return nil
}