]>
git.proxmox.com Git - pve-access-control.git/blob - PVE/CLI/pveum.pm
1 package PVE
::CLI
::pveum
;
6 use PVE
::Tools
qw(run_command);
9 use PVE
::AccessControl
;
10 use File
::Path
qw(make_path remove_tree);
12 use PVE
::RPCEnvironment
;
17 use PVE
::API2
::AccessControl
;
18 use PVE
::JSONSchema
qw(get_standard_option);
22 use base
qw(PVE::CLIHandler);
24 sub setup_environment
{
25 PVE
::RPCEnvironment-
>setup_default_cli_env();
32 'change_password' => [
33 PVE
::CLIHandler
::get_standard_mapping
('pve-password'),
36 PVE
::CLIHandler
::get_standard_mapping
('pve-password', {
38 # do not accept values given on cmdline
39 return PVE
::PTY
::read_password
('Enter password: ');
45 return $mapping->{$name};
50 add
=> [ 'PVE::API2::User', 'create_user', ['userid'] ],
51 modify
=> [ 'PVE::API2::User', 'update_user', ['userid'] ],
52 delete => [ 'PVE::API2::User', 'delete_user', ['userid'] ],
55 add
=> [ 'PVE::API2::Group', 'create_group', ['groupid'] ],
56 modify
=> [ 'PVE::API2::Group', 'update_group', ['groupid'] ],
57 delete => [ 'PVE::API2::Group', 'delete_group', ['groupid'] ],
60 add
=> [ 'PVE::API2::Role', 'create_role', ['roleid'] ],
61 modify
=> [ 'PVE::API2::Role', 'update_role', ['roleid'] ],
62 delete => [ 'PVE::API2::Role', 'delete_role', ['roleid'] ],
65 modify
=> [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 0 }],
66 delete => [ 'PVE::API2::ACL', 'update_acl', ['path'], { delete => 1 }],
68 ticket
=> [ 'PVE::API2::AccessControl', 'create_ticket', ['username'], undef,
71 print "$res->{ticket}\n";
74 passwd
=> [ 'PVE::API2::AccessControl', 'change_password', ['userid'] ],
76 useradd
=> { alias
=> 'user add' },
77 usermod
=> { alias
=> 'user modify' },
78 userdel
=> { alias
=> 'user delete' },
80 groupadd
=> { alias
=> 'group add' },
81 groupmod
=> { alias
=> 'group modify' },
82 groupdel
=> { alias
=> 'group delete' },
84 roleadd
=> { alias
=> 'role add' },
85 rolemod
=> { alias
=> 'role modify' },
86 roledel
=> { alias
=> 'role delete' },
88 aclmod
=> { alias
=> 'acl modify' },
89 acldel
=> { alias
=> 'acl delete' },