From bca8d12b0af8d7ab0141179b08a3e69eddd01e45 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 18 Nov 2013 11:09:05 +0530 Subject: [PATCH] [minor] [fix] has_permission --- webnotes/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/webnotes/__init__.py b/webnotes/__init__.py index 3e1595e246..c1558b9efb 100644 --- a/webnotes/__init__.py +++ b/webnotes/__init__.py @@ -336,9 +336,10 @@ def has_permission(doctype, ptype="read", refdoc=None): """check if user has permission""" from webnotes.utils import cint - meta = get_doctype(doctype) - if session.user=="Administrator" or meta[0].istable==1: + if session.user=="Administrator" or webnotes.conn.get_value("DocType", doctype, "istable")==1: return True + + meta = get_doctype(doctype) # get user permissions user_roles = get_roles()