mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-07-23 19:24:38 +00:00
fix #1998: correct return properties for read_role
we have each privilege as property of the return object, so we generate it from $valid_privs this has the advantage that all privileges are well documented with that api call Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
b54b7474bb
commit
0fea3f1677
@ -163,9 +163,7 @@ __PACKAGE__->register_method ({
|
|||||||
returns => {
|
returns => {
|
||||||
type => "object",
|
type => "object",
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {
|
properties => PVE::AccessControl::create_priv_properties(),
|
||||||
privs => get_standard_option('role-privs'),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
code => sub {
|
code => sub {
|
||||||
my ($param) = @_;
|
my ($param) = @_;
|
||||||
|
@ -499,6 +499,17 @@ sub create_roles {
|
|||||||
|
|
||||||
create_roles();
|
create_roles();
|
||||||
|
|
||||||
|
sub create_priv_properties {
|
||||||
|
my $properties = {};
|
||||||
|
foreach my $priv (keys %$valid_privs) {
|
||||||
|
$properties->{$priv} = {
|
||||||
|
type => 'boolean',
|
||||||
|
optional => 1,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return $properties;
|
||||||
|
}
|
||||||
|
|
||||||
sub role_is_special {
|
sub role_is_special {
|
||||||
my ($role) = @_;
|
my ($role) = @_;
|
||||||
return (exists $special_roles->{$role}) ? 1 : 0;
|
return (exists $special_roles->{$role}) ? 1 : 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user