fix(permissions): cast docname to string

Extension of #24988

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2024-10-22 13:09:25 +05:30
parent 8d6f8bce01
commit d47057cbef
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

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"):