def _validate_resource_type(resource_db): """ Validate that the permissions can be manipulated for the provided resource type. """ resource_type = resource_db.get_resource_type() valid_resource_types = ResourceType.get_valid_values() if resource_type not in valid_resource_types: raise ValueError("Permissions cannot be manipulated for a resource of type: %s" % (resource_type)) return resource_db
def _validate_resource_type(resource_db): """ Validate that the permissions can be manipulated for the provided resource type. """ resource_type = resource_db.get_resource_type() valid_resource_types = ResourceType.get_valid_values() if resource_type not in valid_resource_types: raise ValueError('Permissions cannot be manipulated for a resource of type: %s' % (resource_type)) return resource_db