[pve-devel] [PATCH 1/3] Allow non-root to use start/stop/migrate all buttons

Caspar Smit casparsmit at supernas.eu
Fri Mar 11 12:59:06 CET 2016


Signed-off-by: Caspar Smit <casparsmit at supernas.eu>
---
 PVE/API2/Nodes.pm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/PVE/API2/Nodes.pm b/PVE/API2/Nodes.pm
index 68496d7..d4af788 100644
--- a/PVE/API2/Nodes.pm
+++ b/PVE/API2/Nodes.pm
@@ -1225,6 +1225,9 @@ __PACKAGE__->register_method ({
     path => 'startall', 
     method => 'POST',
     protected => 1,
+    permissions => {
+	check => ['perm', '/', [ 'VM.PowerMgmt' ]],
+    },
     proxyto => 'node',
     description => "Start all VMs and containers (when onboot=1).",
     parameters => {
@@ -1350,6 +1353,9 @@ __PACKAGE__->register_method ({
     path => 'stopall', 
     method => 'POST',
     protected => 1,
+    permissions => {
+	check => ['perm', '/', [ 'VM.PowerMgmt' ]],
+    },
     proxyto => 'node',
     description => "Stop all VMs and Containers.",
     parameters => {
@@ -1463,6 +1469,9 @@ __PACKAGE__->register_method ({
     method => 'POST',
     proxyto => 'node',
     protected => 1,
+    permissions => {
+	check => ['perm', '/', [ 'VM.Migrate' ]],
+    },
     description => "Migrate all VMs and Containers.",
     parameters => {
 	additionalProperties => 0,
-- 
2.1.4




More information about the pve-devel mailing list