src/api2/access/acl.rs: add access permissions
This commit is contained in:
parent
83b6a7cf71
commit
d28ddb8e04
|
@ -1,11 +1,12 @@
|
||||||
use failure::*;
|
use failure::*;
|
||||||
use ::serde::{Deserialize, Serialize};
|
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 proxmox::api::schema::{Schema, StringSchema, BooleanSchema, ApiStringFormat};
|
||||||
|
|
||||||
use crate::api2::types::*;
|
use crate::api2::types::*;
|
||||||
use crate::config::acl;
|
use crate::config::acl;
|
||||||
|
use crate::config::acl::{PRIV_SYS_AUDIT, PRIV_SYS_MODIFY};
|
||||||
|
|
||||||
pub const ACL_PROPAGATE_SCHEMA: Schema = BooleanSchema::new(
|
pub const ACL_PROPAGATE_SCHEMA: Schema = BooleanSchema::new(
|
||||||
"Allow to propagate (inherit) permissions.")
|
"Allow to propagate (inherit) permissions.")
|
||||||
|
@ -119,7 +120,10 @@ fn extract_acl_node_data(
|
||||||
items: {
|
items: {
|
||||||
type: AclListItem,
|
type: AclListItem,
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
access: {
|
||||||
|
permission: &Permission::Privilege(&[], PRIV_SYS_AUDIT, false),
|
||||||
|
},
|
||||||
)]
|
)]
|
||||||
/// Read Access Control List (ACLs).
|
/// Read Access Control List (ACLs).
|
||||||
pub fn read_acl(
|
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).
|
/// Update Access Control List (ACLs).
|
||||||
pub fn update_acl(
|
pub fn update_acl(
|
||||||
|
|
Loading…
Reference in New Issue