fix(get_permitted_fieldnames): Return all fields if permissions not defined
This commit is contained in:
parent
471290bd92
commit
18395b66f0
1 changed files with 8 additions and 1 deletions
|
|
@ -533,8 +533,15 @@ class Meta(Document):
|
|||
return self.high_permlevel_fields
|
||||
|
||||
def get_permitted_fieldnames(self, parenttype=None, *, user=None):
|
||||
"""Build list of `fieldname` with read perm level and all the higher perm levels defined."""
|
||||
"""Build list of `fieldname` with read perm level and all the higher perm levels defined.
|
||||
|
||||
Note: If permissions are not defined for DocType, return all the fields with value.
|
||||
"""
|
||||
permitted_fieldnames = []
|
||||
|
||||
if not self.get_permissions(parenttype=parenttype):
|
||||
return self.get_fieldnames_with_value()
|
||||
|
||||
permlevel_access = set(self.get_permlevel_access("read", parenttype, user=user))
|
||||
|
||||
for df in self.get_fieldnames_with_value(with_field_meta=True, with_virtual_fields=True):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue