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

feature #862: Fixes id check in delete authorization method

This commit is contained in:
Ruben S. Montero 2012-01-05 02:40:44 +01:00
parent 2af47bf630
commit c19345db50

View File

@ -32,23 +32,20 @@ bool RequestManagerDelete::delete_authorization(int oid,
return true;
}
if ( oid >= 0 )
object = pool->get(oid,true);
if ( object == 0 )
{
object = pool->get(oid,true);
if ( object == 0 )
{
failure_response(NO_EXISTS,
get_error(object_name(auth_object),oid),
att);
return false;
}
object->get_permissions(perms);
object->unlock();
failure_response(NO_EXISTS,
get_error(object_name(auth_object),oid),
att);
return false;
}
object->get_permissions(perms);
object->unlock();
AuthRequest ar(att.uid, att.gid);
ar.add_create_auth(auth_object, "");