fix(CustomHTMLBlock): validate private field in server-side

This commit is contained in:
KerollesFathy 2026-04-16 17:32:17 +00:00
parent d8ad02d643
commit 189afcf08b

View file

@ -4,6 +4,7 @@
import frappe
from frappe.model.document import Document
from frappe.query_builder.utils import DocType
from frappe.utils import has_common
class CustomHTMLBlock(Document):
@ -23,7 +24,12 @@ class CustomHTMLBlock(Document):
style: DF.Code | None
# end: auto-generated types
pass
def validate(self):
self.validate_private()
def validate_private(self):
if not has_common(frappe.get_roles(), ["Administrator", "System Manager", "Workspace Manager"]):
self.private = 1
@frappe.whitelist()