Project

Profile

Help

Issue #759

closed

DELETE /v2/repositories/<repo_id>/distributors/<distributor_id>/ requires incorrect permissions

Added by amacdona@redhat.com about 9 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

A DELETE call to /v2/repositories/<repo_id>/distributors/<distributor_id>/ requires UPDATE permissions rather than DELETE.

See line 1

@auth_required(UPDATE)
def DELETE(self, repo_id, distributor_id):
    # validate resources
    manager = manager_factory.repo_distributor_manager()
    manager.get_distributor(repo_id, distributor_id)
    # delete
    task_tags = [
        tags.resource_tag(tags.RESOURCE_REPOSITORY_TYPE, repo_id),
        tags.resource_tag(tags.RESOURCE_REPOSITORY_DISTRIBUTOR_TYPE, distributor_id),
        tags.action_tag('remove_distributor')
    ]
    async_result = repository.distributor_delete.apply_async_with_reservation(
        tags.RESOURCE_REPOSITORY_TYPE, repo_id, [repo_id, distributor_id],
        tags=task_tags)
    raise exceptions.OperationPostponed(async_result)

Note
This will be fixed by the django conversion.

Also available in: Atom PDF