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: status_messages_controller.rb
    path of file: ./repos/open-build-service/src/api/app/controllers/webui
    
    the code of the file until where you have to start completion: class Webui::StatusMessagesController < Webui::WebuiController
  # TODO: Remove this when we'll refactor kerberos_auth
  before_a
    
  def update
    status_message = authorize StatusMessage.find(params[:id])

    if status_message.update(status_message_params)
      flash[:success] = 'News item was successfully updated.'
    else
      flash[:error] = "Could not update news item: #{status_message.errors.full_messages.to_sentence}"
    end