]> git.proxmox.com Git - pve-access-control.git/blob - test.pl
add Pool.Allocate priviledge
[pve-access-control.git] / test.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use PVE::AccessControl;
5
6 # create ticket using username and password
7 #my $ticket = PVE::AccessControl::create_ticket(undef, $username, $password);
8
9 # create ticket using ident auth
10 my $login = getpwuid($<);
11 my $username = ($< == 0) ? 'root' : "$login\@localhost";
12 my $ticket = PVE::AccessControl::create_ticket(undef, $username);
13 print "got ticket using ident auth: $ticket\n";
14
15 for (my $i = 0; $i < 1; $i++) {
16 $ticket = PVE::AccessControl::create_ticket($ticket, $username);
17 print "renewed ticket: $ticket\n";
18 }
19
20 my $user = 'testuser';
21
22 PVE::AccessControl::add_user($ticket, $user, 'testpw');