Skip to content

Commit

Permalink
Make inventories and inventory items disappear for non admins
Browse files Browse the repository at this point in the history
  • Loading branch information
xhero committed Oct 28, 2024
1 parent 67cbae8 commit 15cc3ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/admin/inventory_item.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
ActiveAdmin.register InventoryItem do

collection_action :autocomplete_intentory_item_id, :method => :get

# Hide the menu
menu :parent => "indexes_menu", :label => proc {I18n.t(:menu_inventory_items)}
menu :parent => "indexes_menu", :label => proc {I18n.t(:menu_inventory_items)}, :if => proc{ current_user.has_role?(:admin)}

config.clear_action_items!
# Remove mass-delete action
Expand Down
1 change: 1 addition & 0 deletions app/views/admin/sources/select_new_template.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<div class="panel_contents">
<div class="attributes_table">
<% templates.each do |toplevel, template_list| %>
<% next if toplevel == "inventories" && !current_user.has_role?(:admin) %>
<p><h5 style="margin-bottom: 0;"><%= I18n.t('record_types.' + toplevel) %></h5>
<ul class="template_ul">
<% template_list.each do |label, properties| %>
Expand Down

0 comments on commit 15cc3ab

Please sign in to comment.