<% depositor = f.object.depositor %> <% public_perm = f.object.permissions.map { |perm| perm.access if perm.agent_name == "public"}.compact.first %> <% public_perm = true if params[:controller] == 'batch' %> <% registered_perm = f.object.permissions.map { |perm| perm.access if perm.agent_name == "registered"}.compact.first %>

<% if params[:controller] == 'batch' %>Bulk <% end %>Permissions <% if params[:controller] == 'batch' %> (applied to all files just uploaded)<% end %>

<%= render 'hyrax/base/form_permission', f: f %>

Share With (optional) <%= help_text('hyrax/base/share_with') %>

Enter <%= t('hyrax.account_label') %> (one at a time)

Use the add button to give access to one <%= t('hyrax.account_label') %> at a time (it will be added to the list below). Select the user, by name or <%= t('hyrax.account_label') %>. Then select the access level you wish to grant and click on Add this <%= t('hyrax.account_label') %> to complete adding the permission.

<%= text_field_tag 'new_user_name_skel', nil %>
<%= select_tag 'new_user_permission_skel', options_for_select(Hyrax.config.permission_options), class: 'form-control' %>

Use the add button to give access to one group at a time (it will be added to the list below).

<%= select_tag 'new_group_name_skel', options_for_select(["Select a group"] + current_user.groups), class: 'form-control' %>
<%= select_tag 'new_group_permission_skel', options_for_select(Hyrax.config.permission_options), class: 'form-control' %>
Add this group
<%= f.fields_for :permissions do |permission_fields| %> <%# skip the public, penn state (aka registered), and depositor perms as they are displayed first at the top %> <% next if ['public', 'registered', depositor].include? permission_fields.object.agent_name.downcase %> <% end %>
Person/Group Access Level
<%= label_tag :owner_access, class: "control-label" do %> Depositor (<%= link_to_profile depositor %>) <% end %> <%= Hyrax.config.owner_permission_levels.keys[0] %>
<%= permission_fields.label :agent_name, class: "control-label" do %> <%= user_display_name_and_key(permission_fields.object.agent_name) %> <% end %>
<%= permission_fields.select :access, Hyrax.config.permission_levels, {}, class: 'form-control select_perm' %>