I cannot remove user privileges

puding053

New Member
Mar 1, 2023
1
0
1
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

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!