summaryrefslogtreecommitdiff
path: root/lib/api/projects.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-09-21 13:22:30 +0300
committerDmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com>2012-09-21 13:22:30 +0300
commit10d3a30b255cd85b2cf7af39814fd7418eecd838 (patch)
tree1082a03374c7130ad33f9136d0d41f979bfe603c /lib/api/projects.rb
parent4cc169d3cacea7e4325bb5632cc8878a7c3f41fe (diff)
downloadgitlab-ce-10d3a30b255cd85b2cf7af39814fd7418eecd838.tar.gz
APi for commits. Better api docs
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r--lib/api/projects.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 1d9004f8eed..d6ff02c3cd2 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -40,14 +40,14 @@ module Gitlab
post do
params[:code] ||= params[:name]
params[:path] ||= params[:name]
- attrs = attributes_for_keys [:code,
- :path,
- :name,
- :description,
- :default_branch,
- :issues_enabled,
- :wall_enabled,
- :merge_requests_enabled,
+ attrs = attributes_for_keys [:code,
+ :path,
+ :name,
+ :description,
+ :default_branch,
+ :issues_enabled,
+ :wall_enabled,
+ :merge_requests_enabled,
:wiki_enabled]
@project = Project.create_by_user(attrs, current_user)
if @project.saved?
@@ -207,6 +207,8 @@ module Gitlab
# Example Request:
# POST /projects/:id/snippets
post ":id/snippets" do
+ authorize! :write_snippet, user_project
+
attrs = attributes_for_keys [:title, :file_name]
attrs[:expires_at] = params[:lifetime] if params[:lifetime].present?
attrs[:content] = params[:code] if params[:code].present?
@@ -282,6 +284,8 @@ module Gitlab
# Example Request:
# GET /projects/:id/repository/commits/:sha/blob
get ":id/repository/commits/:sha/blob" do
+ authorize! :download_code, user_project
+
ref = params[:sha]
commit = user_project.commit ref