mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-26 06:50:09 +03:00
bug #3659: Advance GROUP_ADMIN comparison
This commit is contained in:
parent
58cc44b955
commit
0cdb1bba32
@ -530,7 +530,7 @@ bool TemplateAllocate::allocate_authorization(
|
||||
RequestAttributes& att,
|
||||
PoolObjectAuth * cluster_perms)
|
||||
{
|
||||
if ( att.uid == UserPool::ONEADMIN_ID )
|
||||
if ( att.uid == UserPool::ONEADMIN_ID || att.gid == GroupPool::ONEADMIN_ID )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -542,21 +542,17 @@ bool TemplateAllocate::allocate_authorization(
|
||||
VirtualMachineTemplate * ttmpl = static_cast<VirtualMachineTemplate *>(tmpl);
|
||||
|
||||
// ------------ Check template for restricted attributes -------------------
|
||||
|
||||
if ( att.uid != UserPool::ONEADMIN_ID && att.gid != GroupPool::ONEADMIN_ID )
|
||||
if (ttmpl->check(aname))
|
||||
{
|
||||
if (ttmpl->check(aname))
|
||||
{
|
||||
ostringstream oss;
|
||||
ostringstream oss;
|
||||
|
||||
oss << "VM Template includes a restricted attribute " << aname;
|
||||
oss << "VM Template includes a restricted attribute " << aname;
|
||||
|
||||
failure_response(AUTHORIZATION,
|
||||
authorization_error(oss.str(), att),
|
||||
att);
|
||||
failure_response(AUTHORIZATION,
|
||||
authorization_error(oss.str(), att),
|
||||
att);
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -95,8 +95,8 @@ void RequestManagerUpdateTemplate::request_execute(
|
||||
|
||||
object = pool->get(oid,true);
|
||||
|
||||
if ( object == 0 )
|
||||
{
|
||||
if ( object == 0 )
|
||||
{
|
||||
failure_response(NO_EXISTS,
|
||||
get_error(object_name(auth_object),oid),
|
||||
att);
|
||||
|
Loading…
x
Reference in New Issue
Block a user