Skip to content

Add delete endpoints for users#379

Merged
eleftherioszisis merged 8 commits intomainfrom
delete-user
Sep 29, 2025
Merged

Add delete endpoints for users#379
eleftherioszisis merged 8 commits intomainfrom
delete-user

Conversation

@eleftherioszisis
Copy link
Copy Markdown
Contributor

@eleftherioszisis eleftherioszisis commented Sep 26, 2025

  • Users can delete private entities that belong to a project they have access to
  • For access only user_project_ids are taken into account (i.e. project_id in the header is ignored)
  • Globals require an admin context for both regular and admin endpoints.
  • Constrain activity deletion by users to private activities.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 26, 2025

Codecov Report

❌ Patch coverage is 98.02632% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
app/db/utils.py 71.42% 1 Missing and 1 partial ⚠️
app/utils/routers.py 66.66% 1 Missing ⚠️
Flag Coverage Δ
pytest 96.66% <98.02%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/queries/common.py 97.94% <100.00%> (+1.39%) ⬆️
app/routers/admin.py 100.00% <100.00%> (ø)
app/routers/brain_region.py 100.00% <100.00%> (ø)
app/routers/cell_morphology.py 100.00% <100.00%> (ø)
app/routers/cell_morphology_protocol.py 100.00% <100.00%> (ø)
app/routers/circuit.py 100.00% <100.00%> (ø)
app/routers/electrical_cell_recording.py 100.00% <100.00%> (ø)
app/routers/electrical_recording_stimulus.py 100.00% <100.00%> (ø)
app/routers/em_cell_mesh.py 100.00% <100.00%> (ø)
app/routers/emodel.py 100.00% <100.00%> (ø)
... and 62 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread app/service/brain_region.py Outdated
db: SessionDep,
id_: uuid.UUID,
user_context: AdminContextDep, # noqa: ARG001
):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type annotation is missing in some of the delete_one endpoints.
Instead of a generic dict, it would be better if we define a proper schema, so that it's displayed in the openapi docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread tests/test_routes.py Outdated
Copy link
Copy Markdown
Collaborator

@GianlucaFicarelli GianlucaFicarelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eleftherioszisis eleftherioszisis merged commit c627128 into main Sep 29, 2025
2 checks passed
@eleftherioszisis eleftherioszisis deleted the delete-user branch September 29, 2025 13:57
GianlucaFicarelli added a commit that referenced this pull request Sep 29, 2025
* origin/main:
  Add delete endpoints for users (#379)
  Remove ion_channel global type from EntityType (#382)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants