Kanchan Chauhan | 2e8cc89 | 2016-02-19 17:27:23 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import frappe |
| 6 | |
| 7 | from frappe import _ |
| 8 | |
| 9 | def get_context(context): |
| 10 | context.no_cache = 1 |
| 11 | context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name) |
| 12 | context.parents = frappe.form_dict.parents |
| 13 | |
| 14 | if not context.doc.has_website_permission("read"): |
| 15 | frappe.throw(_("Not Permitted"), frappe.PermissionError) |
| 16 | |