1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-11 04:58:16 +03:00

feature #2858: one.vn.[update, update_ar, add_ar, rm_ar] require ADMIN rights

This commit is contained in:
Ruben S. Montero 2014-05-30 16:22:26 +02:00
parent d41ccaf54d
commit 509529bac6
3 changed files with 13 additions and 4 deletions

View File

@ -144,6 +144,7 @@ public:
Nebula& nd = Nebula::instance();
pool = nd.get_vnpool();
auth_object = PoolObjectSQL::NET;
auth_op = AuthRequest::ADMIN;
};
~VirtualNetworkUpdateTemplate(){};

View File

@ -64,7 +64,11 @@ class VirtualNetworkAddAddressRange: public RequestManagerVirtualNetwork
public:
VirtualNetworkAddAddressRange():
RequestManagerVirtualNetwork("VirtualNetworkAddAddressRange",
"Adds address ranges to a virtual network"){};
"Adds address ranges to a virtual network")
{
auth_op = AuthRequest::ADMIN;
};
~VirtualNetworkAddAddressRange(){};
int leases_action(VirtualNetwork * vn,
@ -89,7 +93,7 @@ public:
pool = nd.get_vnpool();
auth_object = PoolObjectSQL::NET;
auth_op = AuthRequest::MANAGE;
auth_op = AuthRequest::ADMIN;
};
~VirtualNetworkRmAddressRange(){};
@ -106,7 +110,11 @@ class VirtualNetworkUpdateAddressRange: public RequestManagerVirtualNetwork
public:
VirtualNetworkUpdateAddressRange():
RequestManagerVirtualNetwork("VirtualNetworkUpdateAddressRange",
"Updates address ranges to a virtual network"){};
"Updates address ranges to a virtual network")
{
auth_op = AuthRequest::ADMIN;
};
~VirtualNetworkUpdateAddressRange(){};
int leases_action(VirtualNetwork * vn,

View File

@ -356,8 +356,8 @@ int VirtualNetworkDelete::drop(int oid, PoolObjectSQL * object, string& error_ms
int freed = vnet->free_addr_by_owner(PoolObjectSQL::NET, oid);
pool->update(vnet);
vnet->unlock();
if (freed > 0)