]> git.proxmox.com Git - proxmox-backup.git/commitdiff
move type defs from src/api2/access/acl.rs to src/api2/types.rs
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Apr 2020 12:12:12 +0000 (14:12 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 17 Apr 2020 12:13:15 +0000 (14:13 +0200)
src/api2/access/acl.rs
src/api2/types.rs

index 82d89072f409f864c2a8336806a26258dac88464..f0823cc2f638539d92c45f3da2b0878f5946f0e8 100644 (file)
@@ -2,41 +2,11 @@ use failure::*;
 use ::serde::{Deserialize, Serialize};
 
 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.")
-    .default(true)
-    .schema();
-
-pub const ACL_PATH_SCHEMA: Schema = StringSchema::new(
-    "Access control path.")
-    .format(&ACL_PATH_FORMAT)
-    .min_length(1)
-    .max_length(128)
-    .schema();
-
-pub const ACL_UGID_TYPE_SCHEMA: Schema = StringSchema::new(
-    "Type of 'ugid' property.")
-    .format(&ApiStringFormat::Enum(&["user", "group"]))
-    .schema();
-
-pub const ACL_ROLE_SCHEMA: Schema = StringSchema::new(
-    "Role.")
-    .format(&ApiStringFormat::Enum(&[
-        "Admin",
-        "Audit",
-        "Datastore.Admin",
-        "Datastore.Audit",
-        "Datastore.User",
-        "NoAccess",
-    ]))
-    .schema();
-
 #[api(
     properties: {
         propagate: {
index 5cb48435e8ae3284dce229e8766d00a112a866f1..2b0f1c7d0ae3ae2768c5d01467681436bab4988e 100644 (file)
@@ -171,6 +171,35 @@ pub const TIME_ZONE_SCHEMA: Schema = StringSchema::new(
     .max_length(64)
     .schema();
 
+pub const ACL_PATH_SCHEMA: Schema = StringSchema::new(
+    "Access control path.")
+    .format(&ACL_PATH_FORMAT)
+    .min_length(1)
+    .max_length(128)
+    .schema();
+
+pub const ACL_PROPAGATE_SCHEMA: Schema = BooleanSchema::new(
+    "Allow to propagate (inherit) permissions.")
+    .default(true)
+    .schema();
+
+pub const ACL_UGID_TYPE_SCHEMA: Schema = StringSchema::new(
+    "Type of 'ugid' property.")
+    .format(&ApiStringFormat::Enum(&["user", "group"]))
+    .schema();
+
+pub const ACL_ROLE_SCHEMA: Schema = StringSchema::new(
+    "Role.")
+    .format(&ApiStringFormat::Enum(&[
+        "Admin",
+        "Audit",
+        "Datastore.Admin",
+        "Datastore.Audit",
+        "Datastore.User",
+        "NoAccess",
+    ]))
+    .schema();
+
 pub const BACKUP_ARCHIVE_NAME_SCHEMA: Schema =
     StringSchema::new("Backup archive name.")
     .format(&PROXMOX_SAFE_ID_FORMAT)