feature #203: Removed authorization from Image and VirtualNetworks in the RM

This commit is contained in:
Tino Vázquez committed 2010-07-12 20:06:26 +02:00
1 parent aff3a57c73
commit 3a76fea711
2 files changed
-34

No files matched your search

-17
View File
@@ -58,19 +58,6 @@ void RequestManager::ImageAllocate::execute(
uid = rc;
//Authorize the operation
if ( uid != 0 ) // uid == 0 means oneadmin
{
AuthRequest ar(uid);
ar.add_auth(AuthRequest::IMAGE,-1,AuthRequest::CREATE,0,false);
if (UserPool::authorize(ar) == -1)
{
goto error_authorize;
}
}
rc = ImageAllocate::ipool->allocate(uid,image_template,&iid);
if ( rc < 0 )
@@ -94,10 +81,6 @@ error_authenticate:
oss << "User not authenticated, aborting ImageAllocate call.";
goto error_common;
error_authorize:
oss << "User not authorized to allocate a new IMAGE";
goto error_common;
error_allocate:
if (rc == -1)
{
@@ -67,19 +67,6 @@ void RequestManager::VirtualNetworkAllocate::execute(
user->unlock();
//Authorize the operation
if ( uid != 0 ) // uid == 0 means oneadmin
{
AuthRequest ar(uid);
ar.add_auth(AuthRequest::NET,-1,AuthRequest::CREATE,0,false);
if (UserPool::authorize(ar) == -1)
{
goto error_authorize;
}
}
rc = vnpool->allocate(uid,stemplate,&nid);
if ( rc < 0 )
@@ -107,10 +94,6 @@ error_get_user:
oss << "User not recognized, cannot allocate VirtualNetwork";
goto error_common;
error_authorize:
oss << "User not authorized to create a VirtualNetwork";
goto error_common;
error_vn_allocate:
oss << "Error allocating VN with template: " << endl << stemplate;
goto error_common;