[minor] allow administrator to edit Page (for role)

This commit is contained in:
Rushabh Mehta 2015-11-25 18:24:08 +05:30
parent bf24fc9661
commit 49ef4130be

View file

@ -29,8 +29,10 @@ class Page(Document):
self.name += '-' + str(cnt)
def validate(self):
if not getattr(conf,'developer_mode', 0):
if self.is_new() and not getattr(conf,'developer_mode', 0):
frappe.throw(_("Not in Developer Mode"))
if frappe.session.user!="Administrator":
frappe.throw(_("Only Administrator can edit"))
# export
def on_update(self):