mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-06-03 06:25:56 +00:00

they have been handled by PVE::RPCEnvironment for quite some time already, and the versions there are the complete ones that should be actually used. manager switched over their last use not long ago, in 6.0-9, so record a Breaks to that version. Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
39 lines
675 B
Perl
Executable File
39 lines
675 B
Perl
Executable File
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use PVE::RPCEnvironment;
|
|
use Getopt::Long;
|
|
use Data::Dumper;
|
|
|
|
# example:
|
|
# dump-perm.pl -f myuser.cfg root /
|
|
|
|
my $opt_file;
|
|
if (!GetOptions ("file=s" => \$opt_file)) {
|
|
exit (-1);
|
|
}
|
|
|
|
my $username = shift;
|
|
my $path = shift;
|
|
|
|
if (!($username && $path)) {
|
|
print "usage: $0 <username> <path>\n";
|
|
exit (-1);
|
|
}
|
|
|
|
my $cfg;
|
|
|
|
my $rpcenv = PVE::RPCEnvironment->init('cli');
|
|
if ($opt_file) {
|
|
$rpcenv->init_request(userconfig => $opt_file);
|
|
} else {
|
|
$rpcenv->init_request();
|
|
}
|
|
|
|
my $perm = $rpcenv->permissions($username, $path);
|
|
|
|
print "permission for user '$username' on '$path':\n";
|
|
print join(',', keys %$perm) . "\n";
|
|
|
|
exit (0);
|