diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-12 09:05:57 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-12 09:18:30 +0300 |
commit | 1405b9cd50ba956c866c41dfc5e7a6758e148d0c (patch) | |
tree | 7955ee3438e6e9e86fcfa1af165a0096ebee0f0d /app/assets/javascripts | |
parent | 4373d0ddad2dfa87421cb127816b4d5774bcb676 (diff) |
Fix "Resolve conflicts" button not appearing for some users
Previously the frontend assumed that the user had to be able to merge to
that project in order to resolve conflicts. However, this is overly
restrictive, as the user only has to be able to push to the source
branch. In fact, appending the text /conflicts to the merge request
would bring up the conflict resolution page.
This confusion happens when a project contains a protected branch that
only allows maintainers to push. Users with Developer access no longer
have permission to merge, but they still can create branches in that
project.
To fix this issue, we now loosen the permission check for the "Resolve
conflicts" button and only check for access to push to the source
branch. This is consistent with what the backend does in
MergeRequests::Conflicts::ListService#can_be_resolved_by?.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/47954
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue index f6f445c1cef..3df4a777aca 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/mr_widget_conflicts.vue @@ -26,7 +26,7 @@ export default { ); }, showResolveButton() { - return this.mr.conflictResolutionPath && this.mr.canMerge; + return this.mr.conflictResolutionPath && this.mr.canPushToSourceBranch; }, showPopover() { return this.showResolveButton && this.mr.sourceBranchProtected; |