api2/roles: change return field of role to roleid

to be compatible with the pve api
with this, we can reuse the ui parts (RoleSelector)

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2020-05-20 12:15:32 +02:00 committed by Dietmar Maurer
parent 5160c0e986
commit b05672579e

View File

@ -16,7 +16,7 @@ use crate::config::acl::{Role, ROLE_NAMES, PRIVILEGES};
type: Object, type: Object,
description: "User name with description.", description: "User name with description.",
properties: { properties: {
role: { roleid: {
type: Role, type: Role,
}, },
privs: { privs: {
@ -49,7 +49,7 @@ fn list_roles() -> Result<Value, Error> {
priv_list.push(name.clone()); priv_list.push(name.clone());
} }
} }
list.push(json!({ "role": role, "privs": priv_list, "comment": comment })); list.push(json!({ "roleid": role, "privs": priv_list, "comment": comment }));
} }
Ok(list.into()) Ok(list.into())
} }