src/api2/access/acl.rs: add access permissions

This commit is contained in:
Dietmar Maurer 2020-04-17 10:03:09 +02:00
parent 83b6a7cf71
commit d28ddb8e04

View File

@ -1,11 +1,12 @@
use failure::*;
use ::serde::{Deserialize, Serialize};
use proxmox::api::{api, Router, RpcEnvironment};
use proxmox::api::{api, Router, RpcEnvironment, Permission};
use proxmox::api::schema::{Schema, StringSchema, BooleanSchema, ApiStringFormat};
use crate::api2::types::*;
use crate::config::acl;
use crate::config::acl::{PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
pub const ACL_PROPAGATE_SCHEMA: Schema = BooleanSchema::new(
"Allow to propagate (inherit) permissions.")
@ -119,7 +120,10 @@ fn extract_acl_node_data(
items: {
type: AclListItem,
}
}
},
access: {
permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
},
)]
/// Read Access Control List (ACLs).
pub fn read_acl(
@ -169,6 +173,9 @@ pub fn read_acl(
},
},
},
access: {
permission: &Permission::Privilege(&[], PRIV_SYS_MODIFY, false),
},
)]
/// Update Access Control List (ACLs).
pub fn update_acl(