Skip to content

Only show Merge Request button when user can create a MR

Toon Claes requested to merge tc-only-mr-button-if-allowed into master

What does this MR do?

It adds another check if the user is allowed to create a Merge Request, if they are not, the "Create Merge Request" button is not shown.

Are there points in the code the reviewer needs to double check?

As mentioned by @DouweM, users still should be able to create a Merge Request to the project they forked from. Tests to ensure this are included in this MR.

Why was this MR needed?

This fixes the 403 issue raised in gitlab-org/gitlab-ce#26055, but the 404 issue remains unresolved (if that really is an issue, see https://gitlab.com/gitlab-org/gitlab-ce/issues/26055#note_21022313).

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

gitlab-org/gitlab-ce#26055

Merge request reports