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|
|
pages.each do |page|
|
||||||
item = {}
|
item = {}
|
||||||
item["obj"] = page
|
item["obj"] = page
|
||||||
|
if (!(page.always_show_on_menu) rescue true)
|
||||||
is_ip = (page.access_level == 'ip')
|
is_ip = (page.access_level == 'ip')
|
||||||
next if !is_ip && !page.user_can_access?(@current_user)
|
next if !is_ip && !page.user_can_access?(@current_user)
|
||||||
|
end
|
||||||
if page.child_page.size > 0
|
if page.child_page.size > 0
|
||||||
item["page_name"] = page.name
|
item["page_name"] = page.name
|
||||||
item['dropdown'] = 'dropdown-menu'
|
item['dropdown'] = 'dropdown-menu'
|
||||||
|
|
Loading…
Reference in New Issue