(
State(ctx): State<S>,
Path(DeleteDatabaseParams { name_or_identity }): Path<DeleteDatabaseParams>,
Extension(auth): Extension<SpacetimeAuth>,
)
| 1348 | } |
| 1349 | |
| 1350 | pub async fn lock_database<S: ControlStateDelegate + Authorization>( |
| 1351 | State(ctx): State<S>, |
| 1352 | Path(DeleteDatabaseParams { name_or_identity }): Path<DeleteDatabaseParams>, |
| 1353 | Extension(auth): Extension<SpacetimeAuth>, |
| 1354 | ) -> axum::response::Result<impl IntoResponse> { |
| 1355 | let database_identity = name_or_identity.resolve(&ctx).await?; |
| 1356 | let Some(_database) = worker_ctx_find_database(&ctx, &database_identity).await? else { |
| 1357 | return Err(StatusCode::NOT_FOUND.into()); |
| 1358 | }; |
| 1359 | |
| 1360 | ctx.authorize_action(auth.claims.identity, database_identity, Action::DeleteDatabase) |
| 1361 | .await?; |
| 1362 | |
| 1363 | ctx.set_database_lock(&auth.claims.identity, &database_identity, true) |
| 1364 | .await |
| 1365 | .map_err(log_and_500)?; |
| 1366 | |
| 1367 | Ok(()) |
| 1368 | } |
| 1369 | |
| 1370 | pub async fn unlock_database<S: ControlStateDelegate + Authorization>( |
| 1371 | State(ctx): State<S>, |
nothing calls this directly
no test coverage detected
searching dependent graphs…