module GalleriesHelper
  def writable?
    !(@gallery.read_only && !@boss_token)
  end
end

module GalleriesHelper
  def writable?
    @gallery && !(@gallery.read_only && !@boss_token)
  end
end

Enable use of "writable?" helper without gallery set.
Enable use of "writable?" helper without gallery set.
