mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-27 13:57:23 +03:00
Feature #2653: Store zone_id in AclManager and send it to PoolObjectAuth
This commit is contained in:
parent
42f05a88ff
commit
2c6049b754
@ -47,11 +47,12 @@ public:
|
|||||||
|
|
||||||
void get_acl_rules(AclRule& owner_rule,
|
void get_acl_rules(AclRule& owner_rule,
|
||||||
AclRule& group_rule,
|
AclRule& group_rule,
|
||||||
AclRule& other_rule) const;
|
AclRule& other_rule,
|
||||||
|
int zone_id) const;
|
||||||
|
|
||||||
string type_to_str() const
|
string type_to_str() const
|
||||||
{
|
{
|
||||||
return PoolObjectSQL::type_to_str(obj_type);
|
return PoolObjectSQL::type_to_str(obj_type);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* --------------------------- Attributes ------------------------------- */
|
/* --------------------------- Attributes ------------------------------- */
|
||||||
|
@ -239,7 +239,7 @@ const bool AclManager::authorize(
|
|||||||
AclRule other_rule;
|
AclRule other_rule;
|
||||||
multimap<long long, AclRule *> tmp_rules;
|
multimap<long long, AclRule *> tmp_rules;
|
||||||
|
|
||||||
obj_perms.get_acl_rules(owner_rule, group_rule, other_rule);
|
obj_perms.get_acl_rules(owner_rule, group_rule, other_rule, zone_id);
|
||||||
|
|
||||||
tmp_rules.insert( make_pair(owner_rule.user, &owner_rule) );
|
tmp_rules.insert( make_pair(owner_rule.user, &owner_rule) );
|
||||||
tmp_rules.insert( make_pair(group_rule.user, &group_rule) );
|
tmp_rules.insert( make_pair(group_rule.user, &group_rule) );
|
||||||
|
@ -20,15 +20,14 @@
|
|||||||
|
|
||||||
void PoolObjectAuth::get_acl_rules(AclRule& owner_rule,
|
void PoolObjectAuth::get_acl_rules(AclRule& owner_rule,
|
||||||
AclRule& group_rule,
|
AclRule& group_rule,
|
||||||
AclRule& other_rule) const
|
AclRule& other_rule,
|
||||||
|
int zone_id) const
|
||||||
{
|
{
|
||||||
long long perm_user, perm_resource, perm_rights, perm_zone;
|
long long perm_user, perm_resource, perm_rights, perm_zone;
|
||||||
|
|
||||||
perm_resource = obj_type | AclRule::INDIVIDUAL_ID | oid;
|
perm_resource = obj_type | AclRule::INDIVIDUAL_ID | oid;
|
||||||
|
|
||||||
// TODO: zone id is 0 in stand alone mode
|
perm_zone = AclRule::INDIVIDUAL_ID | zone_id;
|
||||||
//perm_zone = AclRule::INDIVIDUAL_ID | Nebula::instance().get_zone_id();
|
|
||||||
perm_zone = AclRule::INDIVIDUAL_ID | 0;
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// Rule "#uid ob_type/#oid user_rights #zone"
|
// Rule "#uid ob_type/#oid user_rights #zone"
|
||||||
@ -81,7 +80,7 @@ void PoolObjectAuth::get_acl_rules(AclRule& owner_rule,
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
// Rule "* ob_type/#oid others_rights"
|
// Rule "* ob_type/#oid others_rights"
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
perm_user = AclRule::ALL_ID;
|
perm_user = AclRule::ALL_ID;
|
||||||
perm_rights = 0;
|
perm_rights = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user