Adjust feature that page can show on menu to unauthorized users.
This commit is contained in:
parent
a688857e19
commit
7464fb4979
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue