def copy_perms(parent):
 for d in frappe.get_all(u'DocPerm', fields=u'*', filters=dict(parent=parent)):
  custom_perm = frappe.new_doc(u'Custom DocPerm')
  custom_perm.update(d)
  custom_perm.insert(ignore_permissions=True)

def copy_perms ( parent ) : for d in frappe . get_all ( u'DocPerm' , fields = u'*' , filters = dict ( parent = parent ) ) : custom_perm = frappe . new_doc ( u'Custom DocPerm' ) custom_perm . update ( d ) custom_perm . insert ( ignore_permissions = True )
copy all docperm in to custom docperm for the given document .