fix: Check for command in case of API call

This commit is contained in:
Deepesh Garg 2021-02-24 15:43:03 +05:30
parent 38861decab
commit f2d619bb2c

View file

@ -144,7 +144,7 @@ def rebuild_tree(doctype, parent_field):
"""
# Check for perm if called from client-side
if frappe.request:
if frappe.request and frappe.local.form_dict.cmd == 'rebuild_tree':
frappe.only_for('System Manager')
# get all roots