Skip to content

Commit

Permalink
fix: prevent private pages from showing in sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
mgiadach committed May 29, 2024
1 parent 0d3aafe commit 25fce7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions wiki/wiki/doctype/wiki_page/wiki_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ def get_sidebar_items(self):
continue

wiki_page = frappe.get_doc("Wiki Page", sidebar_item.wiki_page)

if not wiki_page.allow_guest:
permitted = frappe.has_permission(wiki_page.doctype, 'read', wiki_page)
if not permitted:
continue

if sidebar_item.parent_label not in sidebar:
sidebar[sidebar_item.parent_label] = [
{
Expand Down

0 comments on commit 25fce7e

Please sign in to comment.