def validate_permissions_for_doctype(doctype, for_remove=False):
 doctype = frappe.get_doc(u'DocType', doctype)
 if (frappe.conf.developer_mode and (not frappe.flags.in_test)):
  doctype.save()
 else:
  validate_permissions(doctype, for_remove)
  for perm in doctype.get(u'permissions'):
   perm.db_update()

def validate_permissions_for_doctype ( doctype , for_remove = False ) : doctype = frappe . get_doc ( u'DocType' , doctype ) if ( frappe . conf . developer_mode and ( not frappe . flags . in_test ) ) : doctype . save ( ) else : validate_permissions ( doctype , for_remove ) for perm in doctype . get ( u'permissions' ) : perm . db_update ( )
validates if permissions are set correctly .