keystone.common.resource_options.options package

Submodules

Module contents

keystone.common.resource_options.options.check_immutable_delete(resource_ref, resource_type, resource_id)[source]

Check if a delete is allowed on a resource.

Parameters:
  • resource_ref – dict reference of the resource

  • resource_type – resource type (str) e.g. ‘project’

  • resource_id – id of the resource (str) e.g. project[‘id’]

Raises:

ResourceDeleteForbidden

keystone.common.resource_options.options.check_immutable_update(original_resource_ref, new_resource_ref, type, resource_id)[source]

Check if an update is allowed to an immutable resource.

Valid cases where an update is allowed:

  • Resource is not immutable

  • Resource is immutable, and update to set immutable to False or None

Parameters:
  • original_resource_ref – a dict resource reference representing the current resource

  • new_resource_ref – a dict reference of the updates to perform

  • type – the resource type, e.g. ‘project’

  • resource_id – the id of the resource (e.g. project[‘id’]), usually a UUID

Raises:

ResourceUpdateForbidden

keystone.common.resource_options.options.check_resource_immutable(resource_ref)[source]

Check to see if a resource is immutable.

Parameters:

resource_ref – a dict reference of a resource to inspect