fix(dashboard): have get_capabilities iterate Capability::ALL
The hardcoded vec was a maintenance hazard — any new capability added to Capability::ALL would silently be omitted from the permissions UI column list until get_capabilities was manually updated. Now both the GET and POST handlers derive their known-capability lists from the same Capability::ALL source of truth.
This commit is contained in:
parent
febb10a7d7
commit
50f14f28ff
1 changed files with 1 additions and 6 deletions
|
|
@ -2571,12 +2571,7 @@ struct CapabilitiesSnapshot {
|
|||
}
|
||||
|
||||
async fn get_capabilities(State(_state): State<AppState>) -> axum::Json<CapabilitiesSnapshot> {
|
||||
use hive_sh4re::Capability;
|
||||
let caps = vec![
|
||||
Capability::ManageRootAgent.as_str(),
|
||||
Capability::ReadHostJournal.as_str(),
|
||||
Capability::QueryAgentState.as_str(),
|
||||
];
|
||||
let caps = hive_sh4re::Capability::ALL.iter().map(|c| c.as_str()).collect();
|
||||
let assignments = crate::capabilities::read();
|
||||
axum::Json(CapabilitiesSnapshot { caps, assignments })
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue