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: user_badges_controller.rb
    path of file: ./repos/discourse/app/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class U
    
  def destroy
    params.require(:id)
    user_badge = UserBadge.find(params[:id])

    unless can_assign_badge_to_user?(user_badge.user)
      render json: failed_json, status: 403
      return
    end