@click.command(u'reset-perms')
@pass_context
def reset_perms(context):
 from frappe.permissions import reset_perms
 for site in context.sites:
  try:
   frappe.init(site=site)
   frappe.connect()
   for d in frappe.db.sql_list(u'select name from `tabDocType`\n DCTB  DCTB  DCTB  DCTB where istable=0 and custom=0'):
    frappe.clear_cache(doctype=d)
    reset_perms(d)
  finally:
   frappe.destroy()

@ click . command ( u'reset-perms' ) @ pass_context def reset_perms ( context ) : from frappe . permissions import reset_perms for site in context . sites : try : frappe . init ( site = site ) frappe . connect ( ) for d in frappe . db . sql_list ( u'select name from `tabDocType`\n DCTB  DCTB  DCTB  DCTB where istable=0 and custom=0' ) : frappe . clear_cache ( doctype = d ) reset_perms ( d ) finally : frappe . destroy ( )
reset permissions for given doctype .