mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Showing admin for enterprise or admin user
This commit is contained in:
@@ -20,6 +20,10 @@ module SharedHelper
|
||||
end
|
||||
|
||||
def enterprise_user?
|
||||
spree_current_user.andand.enterprises.count > 0
|
||||
spree_current_user.andand.enterprises.andand.count.to_i > 0
|
||||
end
|
||||
|
||||
def admin_user?
|
||||
spree_current_user.andand.has_spree_role? 'admin'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
%a{href: main_app.groups_path}
|
||||
%span.nav-primary Groups
|
||||
%li.divider
|
||||
- if spree_current_user.andand.has_spree_role? 'admin'
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%span.nav-primary Admin
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
%ul.off-canvas-list
|
||||
%li= link_to image_tag("ofn_logo_small.png"), root_path
|
||||
|
||||
- if spree_current_user.andand.has_spree_role? 'admin'
|
||||
- if admin_user? or enterprise_user?
|
||||
%li
|
||||
%a{href: spree.admin_path}
|
||||
%span.nav-primary Admin
|
||||
|
||||
Reference in New Issue
Block a user