fix: getting workspace roles from doc instead from Has Role doctype

This commit is contained in:
Shariq Ansari 2023-09-12 18:10:41 +05:30
parent c3db5fca23
commit cbb80ed0ee

View file

@ -72,9 +72,7 @@ class Workspace:
"""Returns true if Has Role is not set or the user is allowed."""
from frappe.utils import has_common
allowed = [
d.role for d in frappe.get_all("Has Role", fields=["role"], filters={"parent": self.doc.name})
]
allowed = [d.role for d in self.doc.roles]
custom_roles = get_custom_allowed_roles("page", self.doc.name)
allowed.extend(custom_roles)