summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-15 12:25:34 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-08-15 12:25:34 +0000
commitcb33279a0f36f2c6a70d5ecf00bbd8749b92c51b (patch)
tree7300863d69c2efd831b25df7457ea6a0aacd4f8e
parenta8d1cbbecc2f09626ba77556786cbea9b78eb5a9 (diff)
parent6063a1e6c1d7b4877b6f2c1168246977aab15fcd (diff)
downloadgitlab-ce-cb33279a0f36f2c6a70d5ecf00bbd8749b92c51b.tar.gz
Merge branch 'label-permissions' into 'master'
Label permissions * Update label permission docs * Add authorisation to labels via API See merge request !1020
-rw-r--r--doc/permissions/permissions.md1
-rw-r--r--lib/api/labels.rb3
2 files changed, 4 insertions, 0 deletions
diff --git a/doc/permissions/permissions.md b/doc/permissions/permissions.md
index 29fe521b4d1..db22b7dbe56 100644
--- a/doc/permissions/permissions.md
+++ b/doc/permissions/permissions.md
@@ -23,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions.
| Add tags | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ |
| Manage issue tracker | | | ✓ | ✓ | ✓ |
+| Manage labels | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ |
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])