772ba2949685b1c4f6eff4e532ee9009eb161217
[pve-access-control.git] / PVE / CLI / pveum.pm
1 package PVE::CLI::pveum;
2
3 use strict;
4 use warnings;
5 use Getopt::Long;
6 use PVE::Tools qw(run_command);
7 use PVE::Cluster;
8 use PVE::SafeSyslog;
9 use PVE::AccessControl;
10 use File::Path qw(make_path remove_tree);
11 use Term::ReadLine;
12 use PVE::INotify;
13 use PVE::RPCEnvironment;
14 use PVE::API2::User;
15 use PVE::API2::Group;
16 use PVE::API2::Role;
17 use PVE::API2::ACL;
18 use PVE::API2::AccessControl;
19 use PVE::JSONSchema qw(get_standard_option);
20 use PVE::CLIHandler;
21
22 use base qw(PVE::CLIHandler);
23
24 our $cmddef = {
25     ticket => [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef,
26                 sub {
27                     my ($res) = @_;
28                     print "$res->{ticket}\n";
29                 }],
30
31     passwd => [ 'PVE::API2::AccessControl', 'change_passsword', ['userid'] ],
32
33     useradd => [ 'PVE::API2::User', 'create_user', ['userid'] ],
34     usermod => [ 'PVE::API2::User', 'update_user', ['userid'] ],
35     userdel => [ 'PVE::API2::User', 'delete_user', ['userid'] ],
36
37     groupadd => [ 'PVE::API2::Group', 'create_group', ['groupid'] ],
38     groupmod => [ 'PVE::API2::Group', 'update_group', ['groupid'] ],
39     groupdel => [ 'PVE::API2::Group', 'delete_group', ['groupid'] ],
40
41     roleadd => [ 'PVE::API2::Role', 'create_role', ['roleid'] ],
42     rolemod => [ 'PVE::API2::Role', 'update_role', ['roleid'] ],
43     roledel => [ 'PVE::API2::Role', 'delete_role', ['roleid'] ],
44
45     aclmod => [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 0 }],
46     acldel => [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 1 }],
47 };
48
49 1;
50
51 __END__
52
53 =head1 NAME
54
55 pveum - PVE User Manager
56
57 =head1 SYNOPSIS
58
59 =include synopsis
60
61 =head1 DESCRIPTION
62
63 No description available.
64
65 =include pve_copyright