summaryrefslogtreecommitdiff
path: root/lib/api/labels.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-15 11:59:19 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-15 11:59:19 +0300
commit6063a1e6c1d7b4877b6f2c1168246977aab15fcd (patch)
treed2e61026834f585dec37bcb73542569f6ffbf4fd /lib/api/labels.rb
parent27cf081e1b0b1df1661aaf0ae6b60b05ef3eb8d8 (diff)
downloadgitlab-ce-6063a1e6c1d7b4877b6f2c1168246977aab15fcd.tar.gz
Add labels api authorization. Update permission doc
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/labels.rb')
-rw-r--r--lib/api/labels.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/api/labels.rb b/lib/api/labels.rb
index c73a4dbe916..d1684b2293c 100644
--- a/lib/api/labels.rb
+++ b/lib/api/labels.rb
@@ -24,6 +24,7 @@ module API
# Example Request:
# POST /projects/:id/labels
post ':id/labels' do
+ authorize! :admin_label, user_project
required_attributes! [:name, :color]
attrs = attributes_for_keys [:name, :color]
@@ -51,6 +52,7 @@ module API
# Example Request:
# DELETE /projects/:id/labels
delete ':id/labels' do
+ authorize! :admin_label, user_project
required_attributes! [:name]
label = user_project.find_label(params[:name])
@@ -71,6 +73,7 @@ module API
# Example Request:
# PUT /projects/:id/labels
put ':id/labels' do
+ authorize! :admin_label, user_project
required_attributes! [:name]
label = user_project.find_label(params[:name])