Sha256: 6e3b32b552d7f63e07a02b46006a3909f2c98804136580ac1ac792fa4f93834b

Contents?: true

Size: 645 Bytes

Versions: 6

Compression:

Stored size: 645 Bytes

Contents

event :admin_tasks, :initialize, on: :update do
  if (task = Env.params[:task])
    if Auth.always_ok?
      case task.to_sym
      when :clear_cache          then Card::Cache.reset_all
      when :repair_references    then Card::Reference.repair_all
      when :empty_trash          then Card.empty_trash
      when :clear_view_cache     then Card::ViewCache.reset
      when :delete_old_revisions then Card::Action.delete_old
      when :repair_permissions   then Card.repair_all_permissions
      end
      Env.params[:success] = Card[:stats].name
      abort :success
    else
      raise Card::PermissionDenied.new(self)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
card-1.18.6 mod/05_standard/set/self/all.rb
card-1.18.5 mod/05_standard/set/self/all.rb
card-1.18.4 mod/05_standard/set/self/all.rb
card-1.18.3 mod/05_standard/set/self/all.rb
card-1.18.2 mod/05_standard/set/self/all.rb
card-1.18.1 mod/05_standard/set/self/all.rb