diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-04 19:36:22 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-04 19:36:22 +0400 |
commit | bcc4e4dc7ed0740e92a61fc82c3c669f8f2d8d30 (patch) | |
tree | 1df3e2d68cd524af4dce107b2e4227778bb3945d /lib/api/projects.rb | |
parent | 211e435ade337c968fab11c52427c172adcec99a (diff) | |
parent | e0af7cefb4c92b474d14116b40927d70c13e78cc (diff) |
Merge branch 'gist' of https://github.com/Andrew8xx8/gitlabhq into Andrew8xx8-gist
Conflicts:
Gemfile.lock
app/models/ability.rb
app/models/project.rb
app/views/snippets/_form.html.haml
db/schema.rb
features/steps/shared/paths.rb
spec/factories.rb
spec/models/project_spec.rb
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 3711057ecaa..8b20a2fcb14 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -328,7 +328,7 @@ module API # Example Request: # POST /projects/:id/snippets post ":id/snippets" do - authorize! :write_snippet, user_project + authorize! :write_project_snippet, user_project required_attributes! [:title, :file_name, :code] attrs = attributes_for_keys [:title, :file_name] @@ -357,7 +357,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_snippet, @snippet + authorize! :modify_project_snippet, @snippet attrs = attributes_for_keys [:title, :file_name] attrs[:expires_at] = params[:lifetime] if params[:lifetime].present? @@ -380,7 +380,7 @@ module API delete ":id/snippets/:snippet_id" do begin @snippet = user_project.snippets.find(params[:snippet_id]) - authorize! :modify_snippet, user_project + authorize! :modify_project_snippet, @snippet @snippet.destroy rescue end |