diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/issues.rb | 2 | ||||
-rw-r--r-- | lib/api/merge_requests.rb | 4 | ||||
-rw-r--r-- | lib/api/project_snippets.rb | 6 | ||||
-rw-r--r-- | lib/gitlab/git_access_wiki.rb | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index c8db93eb778..ca16d254f14 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -144,7 +144,7 @@ module API # PUT /projects/:id/issues/:issue_id put ":id/issues/:issue_id" do issue = user_project.issues.find(params[:issue_id]) - authorize! :modify_issue, issue + authorize! :update_issue, issue attrs = attributes_for_keys [:title, :description, :assignee_id, :milestone_id, :state_event] # Validate label names in advance diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index d835dce2ded..aa43e1dffd9 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -109,7 +109,7 @@ module API # POST /projects/:id/merge_requests # post ":id/merge_requests" do - authorize! :write_merge_request, user_project + authorize! :create_merge_request, user_project required_attributes! [:source_branch, :target_branch, :title] attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description] @@ -149,7 +149,7 @@ module API put ":id/merge_request/:merge_request_id" do attrs = attributes_for_keys [:target_branch, :assignee_id, :title, :state_event, :description] merge_request = user_project.merge_requests.find(params[:merge_request_id]) - authorize! :modify_merge_request, merge_request + authorize! :update_merge_request, merge_request # Ensure source_branch is not specified if params[:source_branch].present? diff --git a/lib/api/project_snippets.rb b/lib/api/project_snippets.rb index 54f2555903f..22ce3c6a066 100644 --- a/lib/api/project_snippets.rb +++ b/lib/api/project_snippets.rb @@ -46,7 +46,7 @@ module API # Example Request: # POST /projects/:id/snippets post ":id/snippets" do - authorize! :write_project_snippet, user_project + authorize! :create_project_snippet, user_project required_attributes! [:title, :file_name, :code, :visibility_level] attrs = attributes_for_keys [:title, :file_name, :visibility_level] @@ -74,7 +74,7 @@ module API # PUT /projects/:id/snippets/:snippet_id put ":id/snippets/:snippet_id" do @snippet = user_project.snippets.find(params[:snippet_id]) - authorize! :modify_project_snippet, @snippet + authorize! :update_project_snippet, @snippet attrs = attributes_for_keys [:title, :file_name, :visibility_level] attrs[:content] = params[:code] if params[:code].present? @@ -98,7 +98,7 @@ module API delete ":id/snippets/:snippet_id" do begin @snippet = user_project.snippets.find(params[:snippet_id]) - authorize! :modify_project_snippet, @snippet + authorize! :update_project_snippet, @snippet @snippet.destroy rescue not_found!('Snippet') diff --git a/lib/gitlab/git_access_wiki.rb b/lib/gitlab/git_access_wiki.rb index 8ba97184e69..8672cbc0ec4 100644 --- a/lib/gitlab/git_access_wiki.rb +++ b/lib/gitlab/git_access_wiki.rb @@ -1,7 +1,7 @@ module Gitlab class GitAccessWiki < GitAccess def change_access_check(change) - if user.can?(:write_wiki, project) + if user.can?(:create_wiki, project) build_status_object(true) else build_status_object(false, "You are not allowed to write to this project's wiki.") |