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.



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

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:



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

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

Instance Method Details

#callObject



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

def call
  find_or_create_workflow_permissions!
  workflow
end