migrate: move testUserPermissions to list userpermissions in the new cli #518
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch moves the command
testUserPermissionsfrom the legacy CLI tolist userpermissions. I feel like the name could be better, but I also feel like it doesn't really matter so much right now.Unlike in the legacy CLI,
list userpermissionswill output the array of string in json instead of using go output format for a list, I feel like it's more useful. Both arguments USER and PATH are required, I don't feel like making them optional is really useful.fixes #517
Testing
The command can be tested by running :
NEW_CLI=true ./proxmox-api-go -i list userpermissions root@pam / # ["Datastore.Allocate","Datastore.AllocateSpace","Datastore.AllocateTemplate","Datastore.Audit","Group.Allocate","Mapping.Audit","Mapping.Modify","Mapping.Use","Permissions.Modify","Pool.Allocate","Pool.Audit","Realm.Allocate","Realm.AllocateUser","SDN.Allocate","SDN.Audit","SDN.Use","Sys.AccessNetwork","Sys.Audit","Sys.Console","Sys.Incoming","Sys.Modify","Sys.PowerMgmt","Sys.Syslog","User.Modify","VM.Allocate","VM.Audit","VM.Backup","VM.Clone","VM.Config.CDROM","VM.Config.CPU","VM.Config.Cloudinit","VM.Config.Disk","VM.Config.HWType","VM.Config.Memory","VM.Config.Network","VM.Config.Options","VM.Console","VM.GuestAgent.Audit","VM.GuestAgent.FileRead","VM.GuestAgent.FileSystemMgmt","VM.GuestAgent.FileWrite","VM.GuestAgent.Unrestricted","VM.Migrate","VM.PowerMgmt","VM.Replicate","VM.Snapshot","VM.Snapshot.Rollback"]