allow to filter enabled/disabled user

This commit is contained in:
Dietmar Maurer 2012-01-11 12:30:58 +01:00
parent be6ea72391
commit cb6f2f93ed
3 changed files with 21 additions and 3 deletions

View File

@ -2,7 +2,7 @@ RELEASE=2.0
VERSION=1.0
PACKAGE=libpve-access-control
PKGREL=5
PKGREL=6
DESTDIR=
PREFIX=/usr

View File

@ -38,7 +38,13 @@ __PACKAGE__->register_method ({
description => "User index.",
parameters => {
additionalProperties => 0,
properties => {},
properties => {
enabled => {
type => 'boolean',
description => "Optional filter for enable property.",
optional => 1,
}
},
},
returns => {
type => 'array',
@ -61,6 +67,12 @@ __PACKAGE__->register_method ({
next if $user eq 'root';
my $entry = &$extract_user_data($usercfg->{users}->{$user});
if (defined($param->{enabled})) {
next if $entry->{enable} && !$param->{enabled};
next if !$entry->{enable} && $param->{enabled};
}
$entry->{userid} = $user;
push @$res, $entry;
}

View File

@ -1,3 +1,9 @@
libpve-access-control (1.0-6) unstable; urgency=low
* API change: allow to filter enabled/disabled users.
-- Proxmox Support Team <support@proxmox.com> Wed, 11 Jan 2012 12:30:37 +0100
libpve-access-control (1.0-5) unstable; urgency=low
* add a way to return file changes (diffs): set_result_changes()