Skip to content

Commit

Permalink
explicit permission for project deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jkupka committed Feb 5, 2025
1 parent 80353cc commit 6f49a84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pandahub/lib/PandaHub.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class PandaHub:
"read": ["owner", "developer", "guest"],
"write": ["owner", "developer"],
"user_management": ["owner"],
"delete_project": ["owner"],
}

# -------------------------
Expand Down Expand Up @@ -248,7 +249,7 @@ def delete_project(self, i_know_this_action_is_final=False, project_id=None):
if project_id:
self.set_active_project_by_id(project_id)
project_id = self.active_project["_id"]
self.check_permission("write")
self.check_permission("delete_project")
if not i_know_this_action_is_final:
raise PandaHubError(
"Calling this function will delete the whole project and all the nets stored within. It can not be reversed. Add 'i_know_this_action_is_final=True' to confirm."
Expand Down

0 comments on commit 6f49a84

Please sign in to comment.