From f3ec9ca09dc372526ec291567f28514e5a7413e5 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Thu, 4 May 2023 19:22:53 +0200 Subject: [PATCH] make the group 'all' undeletable --- backend/windmill-api/src/groups.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/windmill-api/src/groups.rs b/backend/windmill-api/src/groups.rs index 459655cac4..a3f07ee644 100644 --- a/backend/windmill-api/src/groups.rs +++ b/backend/windmill-api/src/groups.rs @@ -292,6 +292,12 @@ async fn delete_group( ) -> Result { let mut tx = user_db.begin(&authed).await?; + if name == "all" { + return Err(Error::BadRequest( + "The group 'all' is a special group that contains all users and cannot be deleted".to_string(), + )); + } + if !authed.is_admin { require_is_owner(&name, &authed.username, &authed.groups, &w_id, &db).await?; }