Class: Hyrax::Workflow::WorkflowPermissionsGenerator

Inherits:
Object
  • Object
show all
Defined in:
app/services/hyrax/workflow/workflow_permissions_generator.rb

Overview

Responsible for creating database entries for the given workflow’s permissions

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(workflow:, workflow_permissions_configuration:) ⇒ WorkflowPermissionsGenerator

Returns a new instance of WorkflowPermissionsGenerator.



17
18
19
20
# File 'app/services/hyrax/workflow/workflow_permissions_generator.rb', line 17

def initialize(workflow:, workflow_permissions_configuration:)
  self.workflow = workflow
  self.workflow_permissions_configuration = workflow_permissions_configuration
end

Class Method Details

.call(workflow:, workflow_permissions_configuration:) ⇒ Sipity::Workflow

Responsible for creating database entries for the given workflow’s permissions

Parameters:

  • workflow (Sipity::Workflow)
  • workflow_permissions_configuration (Hash)

    as defined in Hyrax::Workflow::WorkflowSchema

Returns:



13
14
15
# File 'app/services/hyrax/workflow/workflow_permissions_generator.rb', line 13

def self.call(workflow:, workflow_permissions_configuration:)
  new(workflow: workflow, workflow_permissions_configuration: workflow_permissions_configuration).call
end

Instance Method Details

#callObject



33
34
35
36
# File 'app/services/hyrax/workflow/workflow_permissions_generator.rb', line 33

def call
  find_or_create_workflow_permissions!
  workflow
end