bug #3659: Advance GROUP_ADMIN comparison

This commit is contained in:
Ruben S. Montero committed 2015-03-08 21:36:20 +01:00
1 parent 58cc44b955
commit 0cdb1bba32
2 files changed
+10 -14

No files matched your search

+8 -12
View File
@@ -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;
+2 -2
View File
@@ -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);