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: destroy_service.rb
    path of file: ./repos/gitlabhq/app/services/ci/deployments
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

    
      def execute(deployment)
        raise Gitlab::Access::AccessDeniedError unless can?(current_user, :destroy_deployment, deployment)

        return ServiceResponse.error(message: 'Cannot destroy running deployment') if deployment&.running?
        return ServiceResponse.error(message: 'Deployment currently deployed to environment') if deployment&.last?

        project.destroy_deployment_by_id(deployment)

        ServiceResponse.success(message: 'Deployment destroyed')
      end