]> git.proxmox.com Git - pve-access-control.git/blobdiff - PVE/API2/Role.pm
return correct 401 status code for unauthorized calls
[pve-access-control.git] / PVE / API2 / Role.pm
index 396ba488f8684994272dd63031ff52249eb13262..6392e133a2bd673dcc96072c11f0a8ded689073f 100644 (file)
@@ -18,6 +18,9 @@ __PACKAGE__->register_method ({
     path => '', 
     method => 'GET',
     description => "Role index.",
+    permissions => { 
+       user => 'all',
+    },
     parameters => {
        additionalProperties => 0,
        properties => {},
@@ -52,6 +55,9 @@ __PACKAGE__->register_method ({
     protected => 1,
     path => '', 
     method => 'POST',
+    permissions => { 
+       check => ['perm', '/access', ['Sys.Modify']],
+    },
     description => "Create new role.",
     parameters => {
        additionalProperties => 0,
@@ -89,6 +95,9 @@ __PACKAGE__->register_method ({
     protected => 1,
     path => '{roleid}', 
     method => 'PUT',
+    permissions => { 
+       check => ['perm', '/access', ['Sys.Modify']],
+    },
     description => "Create new role.",
     parameters => {
        additionalProperties => 0,
@@ -131,6 +140,9 @@ __PACKAGE__->register_method ({
     name => 'read_role', 
     path => '{roleid}', 
     method => 'GET',
+    permissions => { 
+       user => 'all',
+    },
     description => "Get role configuration.",
     parameters => {
        additionalProperties => 0,
@@ -159,6 +171,9 @@ __PACKAGE__->register_method ({
     protected => 1,
     path => '{roleid}', 
     method => 'DELETE',
+    permissions => { 
+       check => ['perm', '/access', ['Sys.Modify']],
+    },
     description => "Delete role.",
     parameters => {
        additionalProperties => 0,