diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-06 14:18:58 +0200 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-04-11 10:51:15 +0200 |
commit | 8ad9c4e873f2185e8bbfa6f363db32dbbba27141 (patch) | |
tree | cefefd09ed7f5b03307f31d240f7a20d757ac185 /app/controllers/projects | |
parent | ec43e3644436e0ae90f6fb6a64256c38ceb68cc9 (diff) | |
download | gitlab-ce-8ad9c4e873f2185e8bbfa6f363db32dbbba27141.tar.gz |
Rename `create_merge_request` permissions
So we can distinguish between the permissions on the source and the
target project.
- `create_merge_request_from` indicates a user can create a merge
request with the project as a source_project
- `create_merge_request_in` indicates a user can create a merge
request with the project as a target_project
Diffstat (limited to 'app/controllers/projects')
-rw-r--r-- | app/controllers/projects/application_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests/creations_controller.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb index cbb14b55399..53a0c712e49 100644 --- a/app/controllers/projects/application_controller.rb +++ b/app/controllers/projects/application_controller.rb @@ -35,7 +35,7 @@ class Projects::ApplicationController < ApplicationController project ||= @project can_create_merge_request = - can?(current_user, :create_merge_request_in_project, project) && + can?(current_user, :create_merge_request_in, project) && current_user.already_forked?(project) can?(current_user, :push_code, project) || diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index b14939c4216..9dcd13b9385 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -20,7 +20,7 @@ class Projects::IssuesController < Projects::ApplicationController before_action :authorize_update_issuable!, only: [:edit, :update, :move] # Allow create a new branch and empty WIP merge request from current issue - before_action :authorize_create_merge_request!, only: [:create_merge_request] + before_action :authorize_create_merge_request_in!, only: [:create_merge_request] respond_to :html diff --git a/app/controllers/projects/merge_requests/creations_controller.rb b/app/controllers/projects/merge_requests/creations_controller.rb index a90030a8312..4a377fefc62 100644 --- a/app/controllers/projects/merge_requests/creations_controller.rb +++ b/app/controllers/projects/merge_requests/creations_controller.rb @@ -5,7 +5,7 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap skip_before_action :merge_request before_action :whitelist_query_limiting, only: [:create] - before_action :authorize_create_merge_request! + before_action :authorize_create_merge_request_from! before_action :apply_diff_view_cookie!, only: [:diffs, :diff_for_path] before_action :build_merge_request, except: [:create] |