'Remove values the user is not allowed to read (called when loading in desk)'

def apply_fieldlevel_read_permissions(self):

    has_higher_permlevel = False
    for p in self.get_permissions():
        if (p.permlevel > 0):
            has_higher_permlevel = True
            break
    if (not has_higher_permlevel):
        return
    has_access_to = self.get_permlevel_access(u'read')
    for df in self.meta.fields:
        if (df.permlevel and (not (df.permlevel in has_access_to))):
            self.set(df.fieldname, None)
    for table_field in self.meta.get_table_fields():
        for df in (frappe.get_meta(table_field.options).fields or []):
            if (df.permlevel and (not (df.permlevel in has_access_to))):
                for child in (self.get(table_field.fieldname) or []):
                    child.set(df.fieldname, None)
