Merge pull request #28225 from akhilnarang/permission-doctype-string-cast

fix(permissions): cast docname to string
This commit is contained in:
Akhil Narang 2024-10-22 13:23:26 +05:30 committed by GitHub
commit b3d9188d08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -388,7 +388,7 @@ def has_user_permission(doc, user=None, debug=False):
# get the list of all allowed values for this link
allowed_docs = get_allowed_docs_for_doctype(user_permissions.get(field.options, []), doctype)
if allowed_docs and d.get(field.fieldname) not in allowed_docs:
if allowed_docs and str(d.get(field.fieldname)) not in allowed_docs:
# restricted for this link field, and no matching values found
# make the right message and exit
if d.get("parentfield"):