fix: Handle the case where can_read does not exist

This commit is contained in:
Suraj Shetty 2020-12-11 12:53:42 +05:30
parent 716f2e850d
commit 957dcbdcda

View file

@ -162,7 +162,7 @@ class Workspace:
item_type = item_type.lower()
if item_type == "doctype":
return (name in self.can_read and name in self.restricted_doctypes)
return (name in self.can_read or [] and name in self.restricted_doctypes or [])
if item_type == "page":
return (name in self.allowed_pages and name in self.restricted_pages)
if item_type == "report":