lib/tasks/qa_approver_setup.rake
# Given an admin set and a role, return relevant Array of Sipity::Users for the
# currently active workflow
# @param [AdminSet] admin_set
# @param [String|Sipity::Role] role e.g., "approving" "depositing" "managing"
# @return [Array<Sipity::Agent>] An array of Sipity::Agent objects
Given an admin set and a role, return relevant Array of Sipity::Users for the
currently active workflow
Given an admin set and a role return relevant Array of Sipity :: Users for the currently active workflow
def users_in_role(admin_set, role)
    return [] unless admin_set.permission_template.available_workflows.exists?(active: true)
    role     = Sipity::Role.find_by!(name: role) unless role.is_a?(Sipity::Role)
    workflow = admin_set.permission_template.available_workflows.find_by(active: true)
    wf_role  = Sipity::WorkflowRole.find_by(workflow: workflow, role_id: role)
    return [] unless wf_role
    Sipity::Agent.where(id: wf_role.workflow_responsibilities.pluck(:agent_id),
                        proxy_for_type: 'User').to_a
  end
def users_in_role ( admin_set , role ) return [ ] unless admin_set . permission_template . available_workflows . exists? ( active : true ) role = Sipity :: Role . find_by! ( name : role ) unless role . is_a? ( Sipity :: Role ) workflow = admin_set . permission_template . available_workflows . find_by ( active : true ) wf_role = Sipity :: WorkflowRole . find_by ( workflow : workflow , role_id : role ) return [ ] unless wf_role Sipity :: Agent . where ( id : wf_role . workflow_responsibilities . pluck ( :agent_id ) , proxy_for_type : 'User' ) . to_a end
Given an admin set and a role, return relevant Array of Sipity::Users for the
currently active workflow
Given an admin set and a role return relevant Array of Sipity :: Users for the currently active workflow
An array of Sipity::Agent objects
An array of Sipity :: Agent objects
Array<Sipity::Agent>
admin_set
<not_specific>
role
<not_specific>
<not_specific>
role e.g., "approving" "depositing" "managing"
role e . g . " approving " " depositing " " managing "