app/jobs/attach_files_to_work_job.rb
# Does the work already have a workflow assigned? And if so,
# is it already in a state where the depositor can edit it?
# If both of those are true, then we want to ensure the
# depositor can also edit all attached filesets.
Does the work already have a workflow assigned. And if so,
is it already in a state where the depositor can edit it.
If both of those are true, then we want to ensure the
depositor can also edit all attached filesets.
Does the work already have a workflow assigned . And if so is it already in a state where the depositor can edit it . If both of those are true then we want to ensure the depositor can also edit all attached filesets .
def in_edit_state?(work)
      return false unless work && work.to_sipity_entity
      Hyrax::Workflow::PermissionQuery
        .scope_permitted_workflow_actions_available_for_current_state(
          user: User.find_by_user_key(work.depositor),
          entity: work.to_sipity_entity
        ).pluck(:name).include?("request_review")
    end
def in_edit_state? ( work ) return false unless work && work . to_sipity_entity Hyrax :: Workflow :: PermissionQuery . scope_permitted_workflow_actions_available_for_current_state ( user : User . find_by_user_key ( work . depositor ) , entity : work . to_sipity_entity ) . pluck ( :name ) . include? ( "request_review" ) end
Does the work already have a workflow assigned?
Does the work already have a workflow assigned?
work
<not_specific>