mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-07-27 08:54:24 +00:00
allow to filter enabled/disabled user
This commit is contained in:
parent
be6ea72391
commit
cb6f2f93ed
2
Makefile
2
Makefile
@ -2,7 +2,7 @@ RELEASE=2.0
|
|||||||
|
|
||||||
VERSION=1.0
|
VERSION=1.0
|
||||||
PACKAGE=libpve-access-control
|
PACKAGE=libpve-access-control
|
||||||
PKGREL=5
|
PKGREL=6
|
||||||
|
|
||||||
DESTDIR=
|
DESTDIR=
|
||||||
PREFIX=/usr
|
PREFIX=/usr
|
||||||
|
@ -38,7 +38,13 @@ __PACKAGE__->register_method ({
|
|||||||
description => "User index.",
|
description => "User index.",
|
||||||
parameters => {
|
parameters => {
|
||||||
additionalProperties => 0,
|
additionalProperties => 0,
|
||||||
properties => {},
|
properties => {
|
||||||
|
enabled => {
|
||||||
|
type => 'boolean',
|
||||||
|
description => "Optional filter for enable property.",
|
||||||
|
optional => 1,
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
returns => {
|
returns => {
|
||||||
type => 'array',
|
type => 'array',
|
||||||
@ -59,8 +65,14 @@ __PACKAGE__->register_method ({
|
|||||||
|
|
||||||
foreach my $user (keys %{$usercfg->{users}}) {
|
foreach my $user (keys %{$usercfg->{users}}) {
|
||||||
next if $user eq 'root';
|
next if $user eq 'root';
|
||||||
|
|
||||||
my $entry = &$extract_user_data($usercfg->{users}->{$user});
|
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;
|
$entry->{userid} = $user;
|
||||||
push @$res, $entry;
|
push @$res, $entry;
|
||||||
}
|
}
|
||||||
|
@ -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
|
libpve-access-control (1.0-5) unstable; urgency=low
|
||||||
|
|
||||||
* add a way to return file changes (diffs): set_result_changes()
|
* add a way to return file changes (diffs): set_result_changes()
|
||||||
|
Loading…
Reference in New Issue
Block a user