Skip to content

Commit

Permalink
fix: do not allow editing other's private workspaces
Browse files Browse the repository at this point in the history
(cherry picked from commit 7343c83)
  • Loading branch information
shariquerik authored and mergify[bot] committed Oct 17, 2023
1 parent caa28b8 commit 11dd3a7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions frappe/desk/doctype/workspace/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ def update_page(name, title, icon, 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
Expand Down

0 comments on commit 11dd3a7

Please sign in to comment.