restore original permissions for standard and custom doctypes (#5498)

This commit is contained in:
Zarrar 2018-04-30 11:29:05 +05:30 committed by Nabin Hait
parent 8923cb6aa9
commit efa359e201

View file

@ -111,6 +111,5 @@ def get_users_with_role(role):
@frappe.whitelist()
def get_standard_permissions(doctype):
frappe.only_for("System Manager")
module = frappe.db.get_value("DocType", doctype, "module")
path = get_file_path(module, "DocType", doctype)
return read_doc_from_file(path).get("permissions")
doc = frappe.get_doc('DocType', doctype)
return [p.as_dict() for p in doc.permissions]