add permission checks

This commit is contained in:
Dietmar Maurer
2012-01-26 08:38:38 +01:00
parent 95e8e21cc5
commit 5f642f73b8
4 changed files with 86 additions and 14 deletions

View File

@ -21,6 +21,9 @@ __PACKAGE__->register_method ({
path => '',
method => 'GET',
description => "List storage content.",
permissions => {
check => ['perm', '/storage/{storage}', ['Datastore.Audit', 'Datastore.AllocateSpace'], any => 1],
},
protected => 1,
proxyto => 'node',
parameters => {
@ -92,6 +95,9 @@ __PACKAGE__->register_method ({
path => '',
method => 'POST',
description => "Allocate disk images.",
permissions => {
check => ['perm', '/storage/{storage}', ['Datastore.AllocateSpace']],
},
protected => 1,
proxyto => 'node',
parameters => {
@ -189,6 +195,9 @@ __PACKAGE__->register_method ({
path => '{volume}',
method => 'GET',
description => "Get volume attributes",
permissions => {
check => ['perm', '/storage/{storage}', ['Datastore.Audit', 'Datastore.AllocateSpace'], any => 1],
},
protected => 1,
proxyto => 'node',
parameters => {
@ -226,6 +235,9 @@ __PACKAGE__->register_method ({
path => '{volume}',
method => 'DELETE',
description => "Delete volume",
permissions => {
check => ['perm', '/storage/{storage}', ['Datastore.AllocateSpace']],
},
protected => 1,
proxyto => 'node',
parameters => {
@ -256,7 +268,7 @@ __PACKAGE__->register_method ({
name => 'copy',
path => '{volume}',
method => 'POST',
description => "Copy a volume.",
description => "Copy a volume. This is experimental code - do not use.",
protected => 1,
proxyto => 'node',
parameters => {