glance.context module

class glance.context.RequestContext(owner_is_tenant=True, service_catalog=None, policy_enforcer=None, **kwargs)[source]

Bases: oslo_context.context.RequestContext

Stores information about the security context.

Stores how the user accesses the system, as well as additional request information.

property can_see_deleted

Admins can see deleted by default

classmethod from_dict(values)[source]

Construct a context object from a provided dictionary.

property owner

Return the owner to correlate with an image.

to_dict()[source]

Return a dictionary of context attributes.

to_policy_values()[source]

A dictionary of context attributes to enforce policy with.

oslo.policy enforcement requires a dictionary of attributes representing the current logged in user on which it applies policy enforcement. This dictionary defines a standard list of attributes that should be available for enforcement across services.

It is expected that services will often have to override this method with either deprecated values or additional attributes used by that service specific policy.

glance.context.get_admin_context(show_deleted=False)[source]

Create an administrator context.