I cannot remove user privileges

puding053

Member
Mar 1, 2023
1
0
6
Hi!

I want to delete VM management rights from a user with API.
The transfer works, but I can't find a way to transfer it anywhere.

What am I trying to do:

$data = [
'path' => '/vms/104',
'users' => 'user@pve',
'roles' => 'PVEVMUser',
];

$proxmox->delete('/access/acl/', $data);

I tried without the 'roles', but it still doesn't work.
Anyone have any tips on how to do it?
 
Hi,

Check the API schema viewer: https://pve.proxmox.com/pve-docs/api-viewer/index.html#/access/acl

The /access/acl/ doesn't implement a DELETE method, but GET and PUT.

For deleting you'd use the PUT one and set delete property to 1 (true), then all permissions that match path, user and role are deleted. IOW., something like:

PHP:
$data = [
    'path' => '/vms/104',
    'users' => 'user@pve',
    'roles' => 'PVEVMUser',
    'delete' => '1',
];

$proxmox->put('/access/acl/', $data);
 
  • Like
Reactions: puding053