Showing admin for enterprise or admin user

This commit is contained in:
Will Marshall
2014-05-20 12:30:28 +10:00
parent 52345d9bb3
commit 4e463e7087
3 changed files with 7 additions and 3 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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