lib/workflow_setup.rb
# Allow anyone with a registered account to deposit into any of the AdminSets
Allow anyone with a registered account to deposit into any of the AdminSets
Allow anyone with a registered account to deposit into any of the AdminSets
def everyone_can_deposit_everywhere
    AdminSet.all.each do |admin_set|
      next if Hyrax::PermissionTemplateAccess
                .find_by(permission_template_id: admin_set.permission_template.id,
                         agent_id:   'registered',
                         access:     'deposit',
                         agent_type: 'group')
      admin_set.permission_template.access_grants.create(agent_type: 'group', agent_id: 'registered', access: 'deposit')
      deposit = Sipity::Role.find_by!(name: 'depositing')
      admin_set.permission_template.available_workflows.each do |workflow|
        workflow.update_responsibilities(role: deposit, agents: Hyrax::Group.new('registered'))
      end
    end
  end
def everyone_can_deposit_everywhere AdminSet . all . each do | admin_set | next if Hyrax :: PermissionTemplateAccess . find_by ( permission_template_id : admin_set . permission_template . id , agent_id : 'registered' , access : 'deposit' , agent_type : 'group' ) admin_set . permission_template . access_grants . create ( agent_type : 'group' , agent_id : 'registered' , access : 'deposit' ) deposit = Sipity :: Role . find_by! ( name : 'depositing' ) admin_set . permission_template . available_workflows . each do | workflow | workflow . update_responsibilities ( role : deposit , agents : Hyrax :: Group . new ( 'registered' ) ) end end end
Allow anyone with a registered account to deposit into any of the AdminSets
Allow anyone with a registered account to deposit into any of the AdminSets