Centralize rights management
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -2,20 +2,6 @@ use crate::controllers::HttpResult;
|
||||
use crate::virtweb_client;
|
||||
use actix_web::HttpResponse;
|
||||
|
||||
#[derive(serde::Serialize)]
|
||||
struct SysInfoStatus {
|
||||
allowed: bool,
|
||||
}
|
||||
|
||||
/// Check if system info can be retrieved
|
||||
pub async fn config() -> HttpResult {
|
||||
let info = virtweb_client::get_token_info().await?;
|
||||
|
||||
Ok(HttpResponse::Ok().json(SysInfoStatus {
|
||||
allowed: info.can_retrieve_system_info(),
|
||||
}))
|
||||
}
|
||||
|
||||
/// Get current system status
|
||||
pub async fn status() -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(virtweb_client::get_server_info().await?))
|
||||
|
Reference in New Issue
Block a user