Skip to content

Commit

Permalink
Merge pull request #243 from mgiadach/fix/pages-on-sidebar
Browse files Browse the repository at this point in the history
fix: prevent private pages from showing in sidebar
  • Loading branch information
rmehta authored Jun 5, 2024
2 parents b309ca0 + 5d530fc commit c01ecd2
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 c01ecd2

Please sign in to comment.