mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-04 00:06:39 +00:00
fix: enforce token path scopes on flows and scripts list_paths
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
86651b4fb7
commit
c253a4fffd
@@ -3562,12 +3562,16 @@ async fn list_paths(
|
||||
) -> JsonResult<Vec<String>> {
|
||||
let mut tx = user_db.begin(&authed).await?;
|
||||
|
||||
let allowed = build_scope_path_predicate(&authed, "scripts", "read");
|
||||
let scripts = sqlx::query_scalar!(
|
||||
"SELECT distinct(path) FROM script WHERE workspace_id = $1",
|
||||
w_id
|
||||
)
|
||||
.fetch_all(&mut *tx)
|
||||
.await?;
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|p| allowed(p))
|
||||
.collect::<Vec<_>>();
|
||||
tx.commit().await?;
|
||||
|
||||
Ok(Json(scripts))
|
||||
|
||||
Reference in New Issue
Block a user