From 154bdd82e7bbd2dc77d8ab3e38488d875975bb86 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 11 Aug 2015 16:47:59 +0530 Subject: [PATCH] [minor] website permissions --- frappe/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frappe/__init__.py b/frappe/__init__.py index f5b5c29b64..86c63f3ba4 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -428,6 +428,9 @@ def has_website_permission(doctype, ptype="read", doc=None, user=None, verbose=F hooks = (get_hooks("has_website_permission") or {}).get(doctype, []) if hooks: + if isinstance(doc, basestring): + doc = get_doc(doctype, doc) + for method in hooks: result = call(get_attr(method), doc=doc, ptype=ptype, user=user, verbose=verbose) # if even a single permission check is Falsy