def is_permitted(self):
		from frappe.utils import has_common

		allowed = [d.role for d in frappe.get_all("Page Role", fields=["role"],
			filters={"parent": self.name})]

		if not allowed:
			return True

		roles = frappe.get_roles()

		if has_common(roles, allowed):
			return True
Returns true if Page Role is not set or the user is allowed.
dataset/ETHPy150Open frappe/frappe/frappe/core/doctype/page/page.py/Page.is_permitted