

def _is_name_allowed_in_acl(self, req, path_parts, identity):
    if (not self.allow_names_in_acls):
        return False
    user_domain_id = identity['user_domain'][0]
    if (user_domain_id and (user_domain_id != self.default_domain_id)):
        return False
    proj_domain_id = identity['project_domain'][0]
    if (proj_domain_id and (proj_domain_id != self.default_domain_id)):
        return False
    (tenant_id, tenant_name) = identity['tenant']
    (version, account, container, obj) = obj
    if self._account_matches_tenant(account, tenant_id):
        allow = True
    else:
        (exists, acc_domain_id) = self._get_project_domain_id(req.environ)
        allow = (exists and (acc_domain_id in [self.default_domain_id, None]))
    if allow:
        self.logger.debug('Names allowed in acls.')
    return allow

dataset/ETHPy150Open openstack/swift/swift/common/middleware/keystoneauth.py KeystoneAuth._is_name_allowed_in_acl/VarMisuse@109/168 `path_parts`->`obj`