mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 13:36:50 +00:00
improve code for is admin (#1082)
This commit is contained in:
@@ -90,7 +90,6 @@ pub mod trace;
|
|||||||
pub mod user;
|
pub mod user;
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(rename_all = "PascalCase")]
|
|
||||||
pub struct IsAdminResponse {
|
pub struct IsAdminResponse {
|
||||||
pub is_admin: bool,
|
pub is_admin: bool,
|
||||||
pub access_key: String,
|
pub access_key: String,
|
||||||
@@ -174,7 +173,7 @@ impl Operation for IsAdminHandler {
|
|||||||
let response = IsAdminResponse {
|
let response = IsAdminResponse {
|
||||||
is_admin,
|
is_admin,
|
||||||
access_key: access_key_to_check,
|
access_key: access_key_to_check,
|
||||||
message: format!("User is {} an administrator", if is_admin { "" } else { "not" }),
|
message: format!("User is {}an administrator", if is_admin { "" } else { "not " }),
|
||||||
};
|
};
|
||||||
|
|
||||||
let data = serde_json::to_vec(&response)
|
let data = serde_json::to_vec(&response)
|
||||||
|
|||||||
Reference in New Issue
Block a user