Skip to content
Snippets Groups Projects
Commit 61eef9e6 authored by Anusha Ranganathan's avatar Anusha Ranganathan
Browse files

Setup both workflows with psrticipants and visibility settings

parent bbcffedc
Branches
Tags
1 merge request!197Bug/fix workflow action visibility 2
......@@ -24,16 +24,27 @@ namespace :hyrax do
Sipity::Workflow.activate!(permission_template: admin_set.permission_template, workflow_id: mediated_workflow.id)
# Update Participants For RUB AdminSet
# Add Participants
pub_manager = ENV.fetch('SYSTEM_PUBLICATION_MANAGER', 'publication_manager@hyrax')
access_grants_params_for_manage = {access_grants_attributes:{'0'=> {agent_type: "user", agent_id: pub_manager, access:"manage"}}}
if title == rub_default_admin_set_title
access_grants_params_for_all_users = {access_grants_attributes:{'0'=> {agent_type: "group", agent_id: 'registered', access:"deposit"}}}
permission_template_form = Hyrax::Forms::PermissionTemplateForm.new(admin_set.permission_template)
permission_template_form.update(access_grants_params_for_all_users)
access_grants_params_for_deposit = {access_grants_attributes:{'0'=> {agent_type: "group", agent_id: 'registered', access:"deposit"}}}
else
access_grants_params_for_deposit = {access_grants_attributes:{'0'=> {agent_type: "group", agent_id: 'crc_1280_member', access:"deposit"}}}
end
permission_template_form = Hyrax::Forms::PermissionTemplateForm.new(admin_set.permission_template)
permission_template_form.update(access_grants_params_for_manage)
permission_template_form.update(access_grants_params_for_deposit)
# Set visibility
visibility_params = {
release_period: Hyrax::PermissionTemplate::RELEASE_TEXT_VALUE_NO_DELAY,
visibility: 'restricted'
}
permission_template_form.update(visibility_params)
end
end
else
puts "Admin Sets not created, No Admin user exist"
puts "Admin Sets not created, No Admin user exists."
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment