fix(Workspace): check perms on deletion (#28315)

This commit is contained in:
Raffael Meyer 2024-10-29 00:35:38 +01:00 committed by GitHub
parent 881d8c8597
commit 09cdf32f00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -118,6 +118,10 @@ class Workspace(Document):
if doc.title != doc.label and doc.label == doc.name:
self.name = doc.name = doc.label = doc.title
def on_trash(self):
if self.public and not is_workspace_manager():
frappe.throw(_("You need to be Workspace Manager to delete a public workspace."))
def after_delete(self):
if disable_saving_as_public():
return