<% depositor = f.object.depositor %>
Share With (optional) <%= f.fields_for :permissions do |permission_fields| %> <%# skip the public, 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 %>
<%= Hyrax.config.owner_permission_levels.keys[0] %> <%= label_tag :owner_access, class: "control-label" do %> Depositor (<%= link_to_profile depositor %>) <% end %>
<%= permission_fields.select :access, Hyrax.config.permission_levels, {}, class: 'form-control select_perm' %> <%= permission_fields.label :agent_name, class: "control-label" do %> <%= user_display_name_and_key(permission_fields.object.agent_name) %> <% end %>

Share work with other users

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' %>

Share work with groups of users

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