Sha256: 7fde48f1bfc2a5c5ca8be2e02a588cbbe7bf7bce1e445d5bf3808cf711c82e6c

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

<%# -# ie. asset[access_person][researcher1] %>
<% unless defined?(person_id) %>
	<% person = edit_person_permissions %>
	<% person_id = person.text %>
<% end %>
 <%#
 -# Don't allow a user to change his own permissions.
-# Currently, just don't render the user's own permissions
-# In the future, we should show current_user's permissions and just disable the ability to modify
 %>

<% if person_id != current_user.login %>
	<% field_name = "#{person_id}_access" %>
	<% choices = [{"No Access" => "none"},{"Discover" => "discover"}, {"Read & Download" => "read"}, {"Edit & Upload" => "edit"}] %>
	<% current_permissions = @document_fedora.datastreams["rightsMetadata"].permissions({"person"=>person_id}) %>
	
	<p class="permission-submit">
  	<label for="<%= field_name %>"><%= person_id %></label>
  	<select id="<%= field_name %>" name="permission[person][<%=h person_id %>]">
    	<% choices.each do |choice| %>
  	  	<% choice_label = choice.keys.first.html_safe %>
  	  	<% choice_name = choice.values.first %>
	  	
  			<option value="<%= choice_name %>" <%= "selected" if current_permissions == choice_name %>>
  	    	<%= choice_label %>
    		</option>
    	<% end %>
  	</select>
	</p>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hydra-head-3.1.0.pre2 app/views/permissions/_edit_person_permissions.html.erb
hydra-head-3.1.0.pre1 app/views/permissions/_edit_person_permissions.html.erb