fix: do not allow editing other's private workspaces
This commit is contained in:
parent
f1c394cafc
commit
7343c83838
1 changed files with 10 additions and 0 deletions
|
|
@ -289,6 +289,16 @@ def update_page(name, title, icon, indicator_color, parent, public):
|
|||
public = frappe.parse_json(public)
|
||||
doc = frappe.get_doc("Workspace", name)
|
||||
|
||||
if (
|
||||
not doc.get("public")
|
||||
and doc.get("for_user") != frappe.session.user
|
||||
and not is_workspace_manager()
|
||||
):
|
||||
frappe.throw(
|
||||
_("Need Workspace Manager role to edit private workspace of other users"),
|
||||
frappe.PermissionError,
|
||||
)
|
||||
|
||||
if doc:
|
||||
doc.title = title
|
||||
doc.icon = icon
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue