lib/snaptable/helpers/buttons_helper.rb in snaptable-0.9.3 vs lib/snaptable/helpers/buttons_helper.rb in snaptable-1.0.0
- old
+ new
@@ -2,29 +2,25 @@
module Helpers
module ButtonsHelper
def add_button?
Snaptable.add_button &&
- (!Snaptable.use_permission ||
- current_permission.allow_create?(params[:controller]))
+ (!Snaptable.use_permission || rights?(:create, params[:controller]))
end
def edit_button?
Snaptable.edit_button &&
- (!Snaptable.use_permission ||
- current_permission.allow_modify?(params[:controller], "update"))
+ (!Snaptable.use_permission || rights?(:update, params[:controller]))
end
def show_button?
Snaptable.show_button &&
- (!Snaptable.use_permission ||
- current_permission.allow_modify?(params[:controller], "read"))
+ (!Snaptable.use_permission || rights?(:read, params[:controller]))
end
def delete_button?
Snaptable.delete_button &&
- (!Snaptable.use_permission ||
- current_permission.allow_modify?(params[:controller], "destroy"))
+ (!Snaptable.use_permission || rights?(:destroy, params[:controller]))
end
end
end
end
\ No newline at end of file