Class: Hyrax::Admin::WorkflowRolePresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/hyrax/admin/workflow_role_presenter.rb

Overview

Displays a single workflow role

Instance Method Summary collapse

Constructor Details

#initialize(workflow_role) ⇒ WorkflowRolePresenter

Returns a new instance of WorkflowRolePresenter.



6
7
8
9
10
# File 'app/presenters/hyrax/admin/workflow_role_presenter.rb', line 6

def initialize(workflow_role)
  @workflow = workflow_role.workflow
  @role = workflow_role.role
  @source_id = workflow.permission_template.source_id
end

Instance Method Details

#labelString

TODO:

This is a hack; I don’t want to include reference to the admin set; However based on the current UI, in which we list all workflows (spanning all admin sets) this is required.

Returns A meaningful label for the given WorkflowRole.

Returns:

  • (String)

    A meaningful label for the given WorkflowRole



15
16
17
# File 'app/presenters/hyrax/admin/workflow_role_presenter.rb', line 15

def label
  "#{admin_set_label(source_id)} - #{role.name} (#{workflow.name})"
end