Skip to content

Update Pages permissions checks

Ben King requested to merge benjaminking-pages-permissions into master

What does this MR do and why?

TO-DO: Documentation updates

This merge request updates the code for the Pages service in GitLab. As noted in this issue, API calls for patch or delete can only be handled by an Administrator due to a check against can_read_all_resources.

This MR considers if the user can :remove_pages or :update_pages to handle the request instead.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Deploy a GitLab Pages project. Ensure that Pages is active.
  2. As the project owner, perform patch (update) and delete (remove) actions via the API endpoints.
  3. Repeat this with a user with Maintainer permissions. The result should stay the same.
  4. Repeat with a user with no permissions and/or Developer permissions. The user will receive a 404.
Edited by Ben King

Merge request reports

Loading