summaryrefslogtreecommitdiff
path: root/app/policies
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-04-06 14:18:58 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2018-04-11 10:51:15 +0200
commit8ad9c4e873f2185e8bbfa6f363db32dbbba27141 (patch)
treecefefd09ed7f5b03307f31d240f7a20d757ac185 /app/policies
parentec43e3644436e0ae90f6fb6a64256c38ceb68cc9 (diff)
downloadgitlab-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/policies')
-rw-r--r--app/policies/project_policy.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb
index 72e30c932a9..ac154270236 100644
--- a/app/policies/project_policy.rb
+++ b/app/policies/project_policy.rb
@@ -140,7 +140,7 @@ class ProjectPolicy < BasePolicy
rule { can?(:guest_access) }.policy do
enable :read_project
- enable :create_merge_request_in_project
+ enable :create_merge_request_in
enable :read_board
enable :read_list
enable :read_wiki
@@ -212,7 +212,7 @@ class ProjectPolicy < BasePolicy
enable :create_pipeline
enable :update_pipeline
enable :create_pipeline_schedule
- enable :create_merge_request
+ enable :create_merge_request_from
enable :create_wiki
enable :push_code
enable :resolve_note
@@ -251,7 +251,8 @@ class ProjectPolicy < BasePolicy
prevent :request_access
prevent :upload_file
prevent :resolve_note
- prevent :create_merge_request_in_project
+ prevent :create_merge_request_from
+ prevent :create_merge_request_in
READONLY_FEATURES_WHEN_ARCHIVED.each do |feature|
prevent(*create_update_admin_destroy(feature))
@@ -263,7 +264,8 @@ class ProjectPolicy < BasePolicy
end
rule { merge_requests_disabled | repository_disabled }.policy do
- prevent :create_merge_request_in_project
+ prevent :create_merge_request_in
+ prevent :create_merge_request_from
prevent(*create_read_update_admin_destroy(:merge_request))
end
@@ -309,7 +311,6 @@ class ProjectPolicy < BasePolicy
rule { can?(:public_access) }.policy do
enable :read_project
- enable :create_merge_request_in_project
enable :read_board
enable :read_list
enable :read_wiki