keystone.common.resource_options.options.immutable module

keystone.common.resource_options.options.immutable module

keystone.common.resource_options.options.immutable.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.immutable.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.immutable.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

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.