fix: Cast to string to handle int PK (#24988)

This commit is contained in:
Ankush Menat 2024-02-21 18:57:38 +05:30 committed by GitHub
parent 2dffcc08ab
commit 99bb5d0303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -355,7 +355,7 @@ def has_user_permission(doc, user=None, debug=False):
# if allowed_docs is empty it states that there is no applicable permission under the current doctype
# only check if allowed_docs is not empty
if allowed_docs and docname not in allowed_docs:
if allowed_docs and str(docname) not in allowed_docs:
# no user permissions for this doc specified
debug and _debug_log(
"User doesn't have access to this document because of User Permissions, allowed documents: "