fix(CustomHTMLBlock): validate private field in server-side
This commit is contained in:
parent
d8ad02d643
commit
189afcf08b
1 changed files with 7 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue