From 99bb5d030390a3e347c01eef516fdcd20b5191c9 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 21 Feb 2024 18:57:38 +0530 Subject: [PATCH] fix: Cast to string to handle int PK (#24988) --- frappe/permissions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/permissions.py b/frappe/permissions.py index dfb5796d1d..0f589560d6 100644 --- a/frappe/permissions.py +++ b/frappe/permissions.py @@ -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: "