class Lato::OperationsController

def show

def show
  @operation = Lato::Operation.find(params[:id])
  return unless validate_user_access_to_operation
end

def validate_user_access_to_operation

def validate_user_access_to_operation
  return true if @operation.lato_user_id == @session.user_id
  respond_to do |format|
    format.html { redirect_to lato.root_path }
    format.json { render plain: '', status: :unauthorized }
  end
  false
end