From 09cdf32f003c67154c3b8b300fc4af5088a5fde2 Mon Sep 17 00:00:00 2001 From: Raffael Meyer <14891507+barredterra@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:35:38 +0100 Subject: [PATCH] fix(Workspace): check perms on deletion (#28315) --- frappe/desk/doctype/workspace/workspace.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frappe/desk/doctype/workspace/workspace.py b/frappe/desk/doctype/workspace/workspace.py index 831819e959..00393f2a7c 100644 --- a/frappe/desk/doctype/workspace/workspace.py +++ b/frappe/desk/doctype/workspace/workspace.py @@ -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