1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

feature #203: Better public in Allocate Methods

This commit is contained in:
Ruben S. Montero 2010-07-14 19:49:16 +02:00
parent 0dbb3330fe
commit 498102b786
2 changed files with 12 additions and 2 deletions

View File

@ -77,12 +77,17 @@ void RequestManager::ImageAllocate::execute(
{
AuthRequest ar(uid);
string t64;
string pub;
string pub_name = "PUBLIC";
img_template->get(pub_name, pub);
transform (pub.begin(), pub.end(), pub.begin(),(int(*)(int))toupper);
ar.add_auth(AuthRequest::IMAGE,
img_template->to_xml(t64),
AuthRequest::CREATE,
uid,
false);
(pub == "YES"));
if (UserPool::authorize(ar) == -1)
{

View File

@ -77,12 +77,17 @@ void RequestManager::VirtualNetworkAllocate::execute(
{
AuthRequest ar(uid);
string t64;
string pub;
string pub_name = "PUBLIC";
vn_template->get(pub_name, pub);
transform (pub.begin(), pub.end(), pub.begin(),(int(*)(int))toupper);
ar.add_auth(AuthRequest::NET,
vn_template->to_xml(t64),
AuthRequest::CREATE,
uid,
false);
(pub == "YES"));
if (UserPool::authorize(ar) == -1)
{