mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 11:22:55 +09:00
bug #3659: Advance GROUP_ADMIN comparison
This commit is contained in:
1 parent
58cc44b955
commit
0cdb1bba32
2 files changed
+10
-14
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user