The nova.context Module

RequestContext: context for requests that persist through all of nova.

class RequestContext(user_id, project_id, is_admin=None, read_deleted='no', roles=None, remote_address=None, timestamp=None, request_id=None, auth_token=None, overwrite=True, quota_class=None, user_name=None, project_name=None, service_catalog=None, instance_lock_checked=False, **kwargs)

Bases: object

Security context and request information.

Represents the user taking a given action within the system.

elevated(read_deleted=None, overwrite=False)

Return a version of this context with admin flag set.

classmethod from_dict(values)
read_deleted
tenant
to_dict()
update_store()
user
authorize_project_context(context, project_id)

Ensures a request has permission to access the given project.

authorize_quota_class_context(context, class_name)

Ensures a request has permission to access the given quota class.

authorize_user_context(context, user_id)

Ensures a request has permission to access the given user.

generate_request_id()
get_admin_context(read_deleted='no')
is_user_context(context)

Indicates if the request context is a normal user.

require_admin_context(ctxt)

Raise exception.AdminRequired() if context is an admin context.

require_context(ctxt)

Raise exception.NotAuthorized() if context is not a user or an admin context.

Previous topic

The nova.consoleauth.rpcapi Module

Next topic

The nova.crypto Module

This Page