module Snaptable module Helpers module ButtonsHelper def add_button? Snaptable.add_button && (!Snaptable.use_permission || rights?(:create, params[:controller])) end def edit_button? Snaptable.edit_button && (!Snaptable.use_permission || rights?(:update, params[:controller])) end def show_button? Snaptable.show_button && (!Snaptable.use_permission || rights?(:read, params[:controller])) end def delete_button? Snaptable.delete_button && (!Snaptable.use_permission || rights?(:destroy, params[:controller])) end end end end