X-Git-Url: https://git.proxmox.com/?p=pve-access-control.git;a=blobdiff_plain;f=PVE%2FAPI2%2FACL.pm;h=866e0237459541ad6c9b246c1cd12eb22f27d21d;hp=d37771b029b425297c8d03aae310f94882582d33;hb=bcf4eb3d4960aa2b3d1e63c482fc35b83bab2c0a;hpb=0a6e09fd4733d877b02d1d2aee26bf90e243b2a0 diff --git a/PVE/API2/ACL.pm b/PVE/API2/ACL.pm index d37771b..866e023 100644 --- a/PVE/API2/ACL.pm +++ b/PVE/API2/ACL.pm @@ -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::JSONSchema qw(get_standard_option register_standard_option); use PVE::SafeSyslog; @@ -13,6 +14,19 @@ use 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 => '', @@ -32,11 +46,11 @@ __PACKAGE__->register_method ({ 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 => { - 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', @@ -108,12 +120,6 @@ __PACKAGE__->register_method ({ 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',