mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-12-03 16:10:37 +00:00
fix: refuse the tools preview to a token withholding superadmin rights, restricted badge after a single access line
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2efcb9b1d9
commit
a67f528425
@@ -389,10 +389,11 @@ pub async fn list_runnable_tools(
|
||||
"A scope-restricted token cannot list its owner's tools".to_string(),
|
||||
));
|
||||
}
|
||||
// The listing runs with the owner's admin rights, which this token does not carry.
|
||||
if authed.admin_withheld {
|
||||
// The listing runs with the owner's admin and superadmin rights, which this token may not
|
||||
// carry: only a credential holding both may list.
|
||||
if authed.admin_withheld || authed.super_admin_withheld {
|
||||
return Err(Error::NotAuthorized(
|
||||
"A token without its owner's admin rights cannot list its owner's tools".to_string(),
|
||||
"A token without all of its owner's rights cannot list its owner's tools".to_string(),
|
||||
));
|
||||
}
|
||||
let w_id = query.workspace_id;
|
||||
|
||||
Reference in New Issue
Block a user