Files
openfoodnetwork/app/helpers/shared_helper.rb
Maikel Linke 54f83b45c8 Replace has_spree_role? with simpler admin?
We have only one role, so let's get rid of the unneeded method.

Now we are in a better place to get rid of Spree::Role and replace it
with a simple boolean.
2024-12-19 09:19:01 +11:00

16 lines
304 B
Ruby

# frozen_string_literal: true
module SharedHelper
def enterprise_user?
spree_current_user&.enterprises&.count.to_i > 0
end
def admin_user?
spree_current_user&.admin?
end
def current_shop_products_path
"#{main_app.enterprise_shop_path(current_distributor)}#/shop_panel"
end
end