From 7464fb497995b1e2f14d625f1dbb2d033de1d8e4 Mon Sep 17 00:00:00 2001 From: bohung Date: Wed, 16 Nov 2022 13:10:41 +0800 Subject: [PATCH] Adjust feature that page can show on menu to unauthorized users. --- app/controllers/site_menu_widgets_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/site_menu_widgets_controller.rb b/app/controllers/site_menu_widgets_controller.rb index 62a1e78..e66ecfb 100644 --- a/app/controllers/site_menu_widgets_controller.rb +++ b/app/controllers/site_menu_widgets_controller.rb @@ -4,8 +4,10 @@ class SiteMenuWidgetsController < ApplicationController pages.each do |page| item = {} item["obj"] = page - is_ip = (page.access_level == 'ip') - next if !is_ip && !page.user_can_access?(@current_user) + if (!(page.always_show_on_menu) rescue true) + is_ip = (page.access_level == 'ip') + next if !is_ip && !page.user_can_access?(@current_user) + end if page.child_page.size > 0 item["page_name"] = page.name item['dropdown'] = 'dropdown-menu'