Class: Dor::StateService

Inherits:
Object
  • Object
show all
Defined in:
lib/dor/services/state_service.rb

Instance Method Summary collapse

Constructor Details

#initialize(pid) ⇒ StateService

Returns a new instance of StateService.



5
6
7
# File 'lib/dor/services/state_service.rb', line 5

def initialize(pid)
  @pid = pid
end

Instance Method Details

#allows_modification?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
# File 'lib/dor/services/state_service.rb', line 9

def allows_modification?
  !client.lifecycle('dor', pid, 'submitted') ||
    client.active_lifecycle('dor', pid, 'opened') ||
    client.workflow_status('dor', pid, 'accessionWF', 'sdr-ingest-transfer') == 'hold'
end