]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/API2/ACL.pm
Add title and print_width fields to properties
[pve-access-control.git] / PVE / API2 / ACL.pm
index d37771b029b425297c8d03aae310f94882582d33..866e0237459541ad6c9b246c1cd12eb22f27d21d 100644 (file)
@@ -6,6 +6,7 @@ use PVE::Cluster qw (cfs_read_file cfs_write_file);
 use PVE::Tools qw(split_list);
 use PVE::AccessControl;
 use PVE::Exception qw(raise_param_exc);
 use PVE::Tools qw(split_list);
 use PVE::AccessControl;
 use PVE::Exception qw(raise_param_exc);
+use PVE::JSONSchema qw(get_standard_option register_standard_option);
 
 use PVE::SafeSyslog;
 
 
 use PVE::SafeSyslog;
 
@@ -13,6 +14,19 @@ use PVE::RESTHandler;
 
 use base qw(PVE::RESTHandler);
 
 
 use base qw(PVE::RESTHandler);
 
+register_standard_option('acl-propagate', {
+    description => "Allow to propagate (inherit) permissions.",
+    type => 'boolean',
+    title => 'Propagate',
+    optional => 1,
+    default => 1,
+});
+register_standard_option('acl-path', {
+    description => "Access control path",
+    title => 'Path',
+    type => 'string',
+});
+
 __PACKAGE__->register_method ({
     name => 'read_acl',
     path => '',
 __PACKAGE__->register_method ({
     name => 'read_acl',
     path => '',
@@ -32,11 +46,11 @@ __PACKAGE__->register_method ({
            type => "object",
            additionalProperties => 0,
            properties => {
            type => "object",
            additionalProperties => 0,
            properties => {
-               path => { type => 'string' },
-               type => { type => 'string', enum => ['user', 'group'] },
-               ugid => { type => 'string' },
-               roleid => { type => 'string' },
-               propagate => { type => 'boolean' },
+               propagate => get_standard_option('acl-propagate'),
+               path => get_standard_option('acl-path'),
+               type => { type => 'string', title => 'Type', enum => ['user', 'group'] },
+               ugid => { type => 'string', title => 'ID' },
+               roleid => { type => 'string', title => 'Role' },
            },
        },
     },
            },
        },
     },
@@ -90,10 +104,8 @@ __PACKAGE__->register_method ({
     parameters => {
        additionalProperties => 0,
        properties => {
     parameters => {
        additionalProperties => 0,
        properties => {
-           path => {
-               description => "Access control path",
-               type => 'string',
-           },
+           propagate => get_standard_option('acl-propagate'),
+           path => get_standard_option('acl-path'),
            users => {
                description => "List of users.",
                type => 'string',  format => 'pve-userid-list',
            users => {
                description => "List of users.",
                type => 'string',  format => 'pve-userid-list',
@@ -108,12 +120,6 @@ __PACKAGE__->register_method ({
                description => "List of roles.",
                type => 'string', format => 'pve-roleid-list',
            },
                description => "List of roles.",
                type => 'string', format => 'pve-roleid-list',
            },
-           propagate => {
-               description => "Allow to propagate (inherit) permissions.",
-               type => 'boolean',
-               optional => 1,
-               default => 1,
-           },
            delete => {
                description => "Remove permissions (instead of adding it).",
                type => 'boolean',
            delete => {
                description => "Remove permissions (instead of adding it).",
                type => 'boolean',