Private Web View

Hi all

I am trying to build a site that is only accessible by users with registered account.
They will be able to view announcements posted by administrators.

From my exploration in ERPnext, the only feature that allow this is the web form.

Is there anyone that can point me in the right direction?
Thank you! :slight_smile:

@jlsy check this:

  1. erpnext/order.html at develop · frappe/erpnext · GitHub
  2. erpnext/ at develop · frappe/erpnext · GitHub

Essentially, you raise frappe.PermissionError when someone unauthorized accesses the page

Thank you so much @anand! :smiley:

@anand, I am facing some issue usring frappe.PermissionError with the web view that is created via Web Generator. The permission error is able to work only once, after i bench restart it. Subsequently, the page is totally public.

Here is my code:

from future import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from import WebsiteGenerator
from import clear_cache

class Meeting1(WebsiteGenerator):
website = frappe._dict(
template = “www/meeting.html”

def validate(self):
self.page_name =


def get_context(self, context):
check_user = 0

if login_test():

if not context.doc.has_website_permission(“read”):
frappe.throw(_(“Not Permitted”), frappe.PermissionError)
check_user = -1

if (check_user == 0):
context.parents = [{“name”: “meetings”, “title”: “Meetings”}]

add this below template = "www/me...