[pve-devel] r5553 - pve-manager/pve2/lib/PVE/API2

svn-commits at proxmox.com svn-commits at proxmox.com
Wed Feb 16 11:41:52 CET 2011


Author: dietmar
Date: 2011-02-16 11:41:52 +0100 (Wed, 16 Feb 2011)
New Revision: 5553

Modified:
   pve-manager/pve2/lib/PVE/API2/Nodes.pm
   pve-manager/pve2/lib/PVE/API2/Services.pm
Log:
check access permissions


Modified: pve-manager/pve2/lib/PVE/API2/Nodes.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Nodes.pm	2011-02-16 10:07:22 UTC (rev 5552)
+++ pve-manager/pve2/lib/PVE/API2/Nodes.pm	2011-02-16 10:41:52 UTC (rev 5553)
@@ -47,6 +47,7 @@
     name => 'index', 
     path => '', 
     method => 'GET',
+    permissions => { user => 'all' },
     description => "Cluster index.",
     parameters => {
     	additionalProperties => 0,
@@ -85,6 +86,10 @@
     name => 'status', 
     path => 'status', 
     method => 'GET',
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Audit' ],
+    },
     description => "Read node status",
     proxyto => 'node',
     parameters => {
@@ -205,6 +210,10 @@
     path => 'vncshell',  
     method => 'POST',
     protected => 1,
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Console' ],
+    },
     description => "Creates a VNC Shell proxy.",
     parameters => {
     	additionalProperties => 0,
@@ -212,10 +221,6 @@
 	    node => get_standard_option('pve-node'),
 	},
     },
-    permissions => {
-	path => '/nodes/{node}',
-	privs => [ 'Sys.Console' ],
-    },
     returns => { 
     	additionalProperties => 0,
 	properties => {
@@ -295,6 +300,10 @@
     name => 'dns', 
     path => 'dns', 
     method => 'GET',
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Audit' ],
+    },
     description => "Read DNS settings.",
     proxyto => 'node',
     parameters => {
@@ -382,6 +391,10 @@
     name => 'time', 
     path => 'time', 
     method => 'GET',
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Audit' ],
+    },
     description => "Read server time and time zone settings.",
     proxyto => 'node',
     parameters => {
@@ -454,6 +467,10 @@
     name => 'upload', 
     path => 'upload',
     method => 'POST',
+    permissions => {
+	path => '/storage/{storage}',
+	privs => [ 'Datastore.AllocateSpace' ],
+    },
     description => "Upload content.",
     parameters => {
     	additionalProperties => 0,
@@ -540,6 +557,7 @@
     name => 'index', 
     path => '', 
     method => 'GET',
+    permissions => { user => 'all' },
     description => "Cluster node index.",
     parameters => {
     	additionalProperties => 0,

Modified: pve-manager/pve2/lib/PVE/API2/Services.pm
===================================================================
--- pve-manager/pve2/lib/PVE/API2/Services.pm	2011-02-16 10:07:22 UTC (rev 5552)
+++ pve-manager/pve2/lib/PVE/API2/Services.pm	2011-02-16 10:41:52 UTC (rev 5553)
@@ -127,6 +127,10 @@
     name => 'index', 
     path => '', 
     method => 'GET',
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Audit' ],
+    },
     description => "Service list.",
     proxyto => 'node',
     protected => 1,
@@ -165,6 +169,10 @@
     name => 'state', 
     path => '{service}', 
     method => 'GET',
+    permissions => {
+	path => '/nodes/{node}',
+	privs => [ 'Sys.Audit' ],
+    },
     description => "Read service properties",
     proxyto => 'node',
     protected => 1,



More information about the pve-devel mailing list