You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Currently, when a collaborator is added to a notebook, it can not leave or delete the notebook. Only the user who has ownership of that notebook can delete a collaborator. The goal of this update will be to give the user the option to leave the notebook when they are a collaborator.
Design
In the notebook setting, we currently have a delete button to delete a notebook. When a collaborator is added to a notebook, this collaborator does not have ownership of this notebook. So, does not have the authorization to delete this notebook. The idea is to have the delete notebook option changed to a "leave" option when the user is a collaborator in that notebook.
Possible Implementation
A new function will be added to the back end of the collaboration resolver. This function will use the existing function to fetch the user ID and remove them from the current notebook, similar to the delete collaborator. A new schema will be needed as well that does not check the collaborator's ownership. This schema can be similar to the delete collaborator's current schema.
@desc"Leave a collaboration"field:leave_collaboration,:collaboratordoarg(:notebook_id,non_null(:id))arg(:user_id,non_null(:id))middlewareSpeakeasy.LoadResource,fn(%{notebook_id: notebook_id})->Cursif.Notebooks.get_notebook!(notebook_id)endmiddlewareSpeakeasy.Authz,{Cursif.Notebooks,:collaborator}resolve(&Collaborators.leave_collaboration/2)end
Objective
Currently, when a collaborator is added to a notebook, it can not leave or delete the notebook. Only the user who has ownership of that notebook can delete a collaborator. The goal of this update will be to give the user the option to leave the notebook when they are a collaborator.
Design
In the notebook setting, we currently have a delete button to delete a notebook. When a collaborator is added to a notebook, this collaborator does not have ownership of this notebook. So, does not have the authorization to delete this notebook. The idea is to have the delete notebook option changed to a "leave" option when the user is a collaborator in that notebook.
Possible Implementation
A new function will be added to the back end of the collaboration resolver. This function will use the existing function to fetch the user ID and remove them from the current notebook, similar to the delete collaborator. A new schema will be needed as well that does not check the collaborator's ownership. This schema can be similar to the delete collaborator's current schema.