diff --git a/backend/windmill-api-flows/src/flows.rs b/backend/windmill-api-flows/src/flows.rs index 97e6999e23..ca3d65b2ce 100644 --- a/backend/windmill-api-flows/src/flows.rs +++ b/backend/windmill-api-flows/src/flows.rs @@ -1622,6 +1622,11 @@ async fn archive_flow_by_path( Path((w_id, path)): Path<(String, StripPath)>, Json(archived): Json, ) -> Result { + if authed.is_operator { + return Err(Error::NotAuthorized( + "Operators cannot archive flows for security reasons".to_string(), + )); + } let path = path.to_path(); check_scopes(&authed, || format!("flows:write:{}", path))?; if let RuleCheckResult::Blocked(msg) = check_deploy_rules( @@ -1762,6 +1767,11 @@ async fn delete_flow_by_path( Path((w_id, path)): Path<(String, StripPath)>, Query(query): Query, ) -> Result { + if authed.is_operator { + return Err(Error::NotAuthorized( + "Operators cannot delete flows for security reasons".to_string(), + )); + } let path = path.to_path(); check_scopes(&authed, || format!("flows:write:{}", path))?; if let RuleCheckResult::Blocked(msg) = check_deploy_rules( diff --git a/backend/windmill-api/src/apps.rs b/backend/windmill-api/src/apps.rs index 4a6d5134d2..acd3a5eabf 100644 --- a/backend/windmill-api/src/apps.rs +++ b/backend/windmill-api/src/apps.rs @@ -2121,6 +2121,11 @@ async fn delete_app( Extension(webhook): Extension, Path((w_id, path)): Path<(String, StripPath)>, ) -> Result { + if authed.is_operator { + return Err(Error::NotAuthorized( + "Operators cannot delete apps for security reasons".to_string(), + )); + } let path = path.to_path(); check_scopes(&authed, || format!("apps:write:{}", path))?;