[Permission Management](https://pve.proxmox.com/wiki/User_Management)
---------------------------------------------------------------------
[In order for a user to perform an action (such as listing, modifying or deleting a parts of a VM configuration), the user needs to have the appropriate permissions.](https://pve.proxmox.com/wiki/User_Management)
[Proxmox VE uses a role and path based permission management system. An entry in the permissions table allows a user or group to take on a specific role when accessing an ](https://pve.proxmox.com/wiki/User_Management)[*object*](https://pve.proxmox.com/wiki/User_Management) or [*path*](https://pve.proxmox.com/wiki/User_Management). This means an such an access rule can be represented as a triple of [*(path, user, role)*](https://pve.proxmox.com/wiki/User_Management) or [*(path, group, role)*](https://pve.proxmox.com/wiki/User_Management), with the role containing a set of allowed actions, and the path representing the target of these actions.
### [Roles](https://pve.proxmox.com/wiki/User_Management)
[A role is simply a list of privileges. Proxmox VE comes with a number of predefined roles which satisfies most needs.](https://pve.proxmox.com/wiki/User_Management)
- [Administrator](https://pve.proxmox.com/wiki/User_Management): 擁有所有特權
- [NoAccess](https://pve.proxmox.com/wiki/User_Management): 沒有特權 (used to forbid access)
- [PVEAdmin](https://pve.proxmox.com/wiki/User_Management): can do most things, but miss rights to modify system settings ([Sys.PowerMgmt](https://pve.proxmox.com/wiki/User_Management), [Sys.Modify](https://pve.proxmox.com/wiki/User_Management), [Realm.Allocate](https://pve.proxmox.com/wiki/User_Management)).
- [PVEAuditor](https://pve.proxmox.com/wiki/User_Management): read only access
- [PVEDatastoreAdmin](https://pve.proxmox.com/wiki/User_Management): create and allocate backup space and templates
- [PVEDatastoreUser](https://pve.proxmox.com/wiki/User_Management): allocate backup space and view storage
- [PVEPoolAdmin](https://pve.proxmox.com/wiki/User_Management): allocate pools
- [PVESysAdmin](https://pve.proxmox.com/wiki/User_Management): User ACLs, audit, system console and system logs
- [PVETemplateUser](https://pve.proxmox.com/wiki/User_Management): view and clone templates
- [PVEUserAdmin](https://pve.proxmox.com/wiki/User_Management): user administration
- [PVEVMAdmin](https://pve.proxmox.com/wiki/User_Management): 完全管理 VM
- [PVEVMUser](https://pve.proxmox.com/wiki/User_Management): view, backup, config CDROM, VM console, VM power management
[You can see the whole set of predefined roles on the GUI.](https://pve.proxmox.com/wiki/User_Management)
[Adding new roles can be done via both GUI and the command line, like this:](https://pve.proxmox.com/wiki/User_Management)
### [Privileges](https://pve.proxmox.com/wiki/User_Management)
[A privilege is the right to perform a specific action. To simplify management, lists of privileges are grouped into roles, which can then be used in the permission table. Note that privileges cannot directly be assigned to users and paths without being part of a role.](https://pve.proxmox.com/wiki/User_Management)
[We currently use the following privileges:](https://pve.proxmox.com/wiki/User_Management)
- [Node / System related privileges](https://pve.proxmox.com/wiki/User_Management)
- [Permissions.Modify](https://pve.proxmox.com/wiki/User_Management): modify access permissions
- [Sys.PowerMgmt](https://pve.proxmox.com/wiki/User_Management): Node power management (start, stop, reset, shutdown, …)
- [Sys.Console](https://pve.proxmox.com/wiki/User_Management): console access to Node
- [Sys.Syslog](https://pve.proxmox.com/wiki/User_Management): view Syslog
- [Sys.Audit](https://pve.proxmox.com/wiki/User_Management): view node status/config, Corosync cluster config and HA config
- [Sys.Modify](https://pve.proxmox.com/wiki/User_Management): create/remove/modify node network parameters
- [Group.Allocate](https://pve.proxmox.com/wiki/User_Management): create/remove/modify groups
- [Pool.Allocate](https://pve.proxmox.com/wiki/User_Management): create/remove/modify a pool
- [Realm.Allocate](https://pve.proxmox.com/wiki/User_Management): create/remove/modify authentication realms
- [Realm.AllocateUser](https://pve.proxmox.com/wiki/User_Management): assign user to a realm
- [User.Modify](https://pve.proxmox.com/wiki/User_Management): create/remove/modify user access and details.
- [Virtual machine related privileges](https://pve.proxmox.com/wiki/User_Management)
- [VM.Allocate](https://pve.proxmox.com/wiki/User_Management): create/remove new VM to server inventory
- [VM.Migrate](https://pve.proxmox.com/wiki/User_Management): migrate VM to alternate server on cluster
- [VM.PowerMgmt](https://pve.proxmox.com/wiki/User_Management): power management (start, stop, reset, shutdown, …)
- [VM.Console](https://pve.proxmox.com/wiki/User_Management): console access to VM
- [VM.Monitor](https://pve.proxmox.com/wiki/User_Management): access to VM monitor (kvm)
- [VM.Backup](https://pve.proxmox.com/wiki/User_Management): backup/restore VMs
- [VM.Audit](https://pve.proxmox.com/wiki/User_Management): view VM config
- [VM.Clone](https://pve.proxmox.com/wiki/User_Management): clone/copy a VM
- [VM.Config.Disk](https://pve.proxmox.com/wiki/User_Management): add/modify/delete Disks
- [VM.Config.CDROM](https://pve.proxmox.com/wiki/User_Management): eject/change CDROM
- [VM.Config.CPU](https://pve.proxmox.com/wiki/User_Management): modify CPU settings
- [VM.Config.Memory](https://pve.proxmox.com/wiki/User_Management): modify Memory settings
- [VM.Config.Network](https://pve.proxmox.com/wiki/User_Management): add/modify/delete Network devices
- [VM.Config.HWType](https://pve.proxmox.com/wiki/User_Management): modify emulated HW type
- [VM.Config.Options](https://pve.proxmox.com/wiki/User_Management): modify any other VM configuration
- [VM.Snapshot](https://pve.proxmox.com/wiki/User_Management): create/remove VM snapshots
- [Storage related privileges](https://pve.proxmox.com/wiki/User_Management)
- [Datastore.Allocate](https://pve.proxmox.com/wiki/User_Management): create/remove/modify a data store, delete volumes
- [Datastore.AllocateSpace](https://pve.proxmox.com/wiki/User_Management): allocate space on a datastore
- [Datastore.AllocateTemplate](https://pve.proxmox.com/wiki/User_Management): allocate/upload templates and iso images
- [Datastore.Audit](https://pve.proxmox.com/wiki/User_Management): view/browse a datastore
### [Objects and Paths](https://pve.proxmox.com/wiki/User_Management)
[Access permissions are assigned to objects, such as a virtual machines, storages or pools of resources. We use file system like paths to address these objects. These paths form a natural tree, and permissions of higher levels (shorter path) can optionally be propagated down within this hierarchy.](https://pve.proxmox.com/wiki/User_Management)
[Paths can be templated. When an API call requires permissions on a templated path, the path may contain references to parameters of the API call. These references are specified in curly braces. Some parameters are implicitly taken from the API call’s URI. For instance the permission path ](https://pve.proxmox.com/wiki/User_Management)[/nodes/{node}](https://pve.proxmox.com/wiki/User_Management) when calling [*/nodes/mynode/status*](https://pve.proxmox.com/wiki/User_Management) requires permissions on [/nodes/mynode](https://pve.proxmox.com/wiki/User_Management), while the path [{path}](https://pve.proxmox.com/wiki/User_Management) in a PUT request to [/access/acl](https://pve.proxmox.com/wiki/User_Management) refers to the method’s [path](https://pve.proxmox.com/wiki/User_Management) parameter.
[Some examples are:](https://pve.proxmox.com/wiki/User_Management)
- [/nodes/{node}](https://pve.proxmox.com/wiki/User_Management): Access to Proxmox VE server machines
- [/vms](https://pve.proxmox.com/wiki/User_Management): Covers all VMs
- [/vms/{vmid}](https://pve.proxmox.com/wiki/User_Management): Access to specific VMs
- [/storage/{storeid}](https://pve.proxmox.com/wiki/User_Management): Access to a storages
- [/pool/{poolname}](https://pve.proxmox.com/wiki/User_Management): Access to VMs part of a [pool](https://pve.proxmox.com/wiki/User_Management#pveum_pools)
- [/access/groups](https://pve.proxmox.com/wiki/User_Management): Group administration
- [/access/realms/{realmid}](https://pve.proxmox.com/wiki/User_Management): Administrative access to realms
#### [Inheritance](https://pve.proxmox.com/wiki/User_Management)
[As mentioned earlier, object paths form a file system like tree, and permissions can be inherited down that tree (the propagate flag is set by default). We use the following inheritance rules:](https://pve.proxmox.com/wiki/User_Management)
- [Permissions for individual users always replace group permissions.](https://pve.proxmox.com/wiki/User_Management)
- [Permissions for groups apply when the user is member of that group.](https://pve.proxmox.com/wiki/User_Management)
- [Permissions replace the ones inherited from an upper level.](https://pve.proxmox.com/wiki/User_Management)
### [Pools](https://pve.proxmox.com/wiki/User_Management)
[Pools can be used to group a set of virtual machines and data stores. You can then simply set permissions on pools (](https://pve.proxmox.com/wiki/User_Management)[/pool/{poolid}](https://pve.proxmox.com/wiki/User_Management)), which are inherited to all pool members. This is a great way simplify access control.
### [What permission do I need?](https://pve.proxmox.com/wiki/User_Management)
[The required API permissions are documented for each individual method, and can be found at ](https://pve.proxmox.com/wiki/User_Management)
[The permissions are specified as a list which can be interpreted as a tree of logic and access-check functions:](https://pve.proxmox.com/wiki/User_Management)
- [\["and", <subtests>...\]](https://pve.proxmox.com/wiki/User_Management) and [\["or", <subtests>...\]](https://pve.proxmox.com/wiki/User_Management)
- [Each(](https://pve.proxmox.com/wiki/User_Management)[and](https://pve.proxmox.com/wiki/User_Management)) or any([or](https://pve.proxmox.com/wiki/User_Management)) further element in the current list has to be true.
- [\["perm", <path>, \[ <privileges>... \], <options>...\]](https://pve.proxmox.com/wiki/User_Management)
- [The ](https://pve.proxmox.com/wiki/User_Management)[path](https://pve.proxmox.com/wiki/User_Management) is a templated parameter (see [Objects and Paths](https://pve.proxmox.com/wiki/User_Management#pveum_templated_paths)[). All (or , if the ](https://pve.proxmox.com/wiki/User_Management)[any](https://pve.proxmox.com/wiki/User_Management) option is used, any) of the listed privileges must be allowed on the specified path. If a [require-param](https://pve.proxmox.com/wiki/User_Management) option is specified, then its specified parameter is required even if the API call’s schema otherwise lists it as being optional.
- [\["userid-group", \[ <privileges>... \], <options>...\]](https://pve.proxmox.com/wiki/User_Management)
- [The caller must have any of the listed privileges on ](https://pve.proxmox.com/wiki/User_Management)[/access/groups](https://pve.proxmox.com/wiki/User_Management). In addition there are two possible checks depending on whether the [groups\_param](https://pve.proxmox.com/wiki/User_Management) option is set:
- [groups\_param](https://pve.proxmox.com/wiki/User_Management) is set: The API call has a non-optional [groups](https://pve.proxmox.com/wiki/User_Management) parameter and the caller must have any of the listed privileges on all of the listed groups.
- [groups\_param](https://pve.proxmox.com/wiki/User_Management) is not set: The user passed via the [userid](https://pve.proxmox.com/wiki/User_Management) parameter must exist and be part of a group on which the caller has any of the listed privileges (via the [/access/groups/<group>](https://pve.proxmox.com/wiki/User_Management) path).
- [\["userid-param", "self"\]](https://pve.proxmox.com/wiki/User_Management)
- [The value provided for the API call’s ](https://pve.proxmox.com/wiki/User_Management)[userid](https://pve.proxmox.com/wiki/User_Management) parameter must refer to the user performing the action. (Usually in conjunction with [or](https://pve.proxmox.com/wiki/User_Management), to allow users to perform an action on themselves even if they don’t have elevated privileges.)
- [\["userid-param", "Realm.AllocateUser"\]](https://pve.proxmox.com/wiki/User_Management)
- [The user needs ](https://pve.proxmox.com/wiki/User_Management)[Realm.AllocateUser](https://pve.proxmox.com/wiki/User_Management) access to [/access/realm/<realm>](https://pve.proxmox.com/wiki/User_Management), with [<realm>](https://pve.proxmox.com/wiki/User_Management) referring to the realm of the user passed via the [userid](https://pve.proxmox.com/wiki/User_Management) parameter. Note that the user does not need to exist in order to be associated with a realm, since user IDs are passed in the form of [<username>@<realm>](https://pve.proxmox.com/wiki/User_Management).
- [\["perm-modify", <path>\]](https://pve.proxmox.com/wiki/User_Management)
- [The ](https://pve.proxmox.com/wiki/User_Management)[path](https://pve.proxmox.com/wiki/User_Management) is a templated parameter (see [Objects and Paths](https://pve.proxmox.com/wiki/User_Management#pveum_templated_paths)[). The user needs either the ](https://pve.proxmox.com/wiki/User_Management)[Permissions.Modify](https://pve.proxmox.com/wiki/User_Management) privilege, or, depending on the path, the following privileges as a possible substitute:
- [
/storage/...](https://pve.proxmox.com/wiki/User_Management): additionally requires 'Datastore.Allocate`
- [
/vms/...](https://pve.proxmox.com/wiki/User_Management): additionally requires 'VM.Allocate`
- [
/pool/...](https://pve.proxmox.com/wiki/User_Management): additionally requires 'Pool.Allocate`
[If the path is empty, ](https://pve.proxmox.com/wiki/User_Management)[Permission.Modify](https://pve.proxmox.com/wiki/User_Management) on [/access](https://pve.proxmox.com/wiki/User_Management) is required.