def __init__(self, auth_tok=None, user=None, tenant=None, roles=None, is_admin=False, read_only=False, show_deleted=False, owner_is_tenant=True, service_catalog=None, policy_enforcer=None): self.auth_tok = auth_tok self.user = user self.tenant = tenant self.roles = roles or [] self.read_only = read_only # TODO(jwood): self._show_deleted = show_deleted # (mkbhanda) possibly domain could be owner # brings us to the key scope question self.owner_is_tenant = owner_is_tenant self.request_id = uuidutils.generate_uuid() self.service_catalog = service_catalog self.policy_enforcer = policy_enforcer or policy.Enforcer() self.is_admin = is_admin # TODO(jwood): Is this needed? # if not self.is_admin: # self.is_admin = \ # self.policy_enforcer.check_is_admin(self) if not hasattr(local.store, 'context'): self.update_store()
def __init__( self, auth_tok=None, user=None, tenant=None, roles=None, is_admin=False, read_only=False, show_deleted=False, owner_is_tenant=True, service_catalog=None, policy_enforcer=None, ): self.auth_tok = auth_tok self.user = user self.tenant = tenant self.roles = roles or [] self.read_only = read_only # TODO(jwood): self._show_deleted = show_deleted # (mkbhanda) possibly domain could be owner # brings us to the key scope question self.owner_is_tenant = owner_is_tenant self.request_id = uuidutils.generate_uuid() self.service_catalog = service_catalog self.policy_enforcer = policy_enforcer or policy.Enforcer() self.is_admin = is_admin # TODO(jwood): Is this needed? # if not self.is_admin: # self.is_admin = \ # self.policy_enforcer.check_is_admin(self) if not hasattr(local.store, "context"): self.update_store()
def generate_request_id(): return 'req-%s' % uuidutils.generate_uuid()