Commit 6063a1e6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add labels api authorization. Update permission doc

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 27cf081e
...@@ -23,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions. ...@@ -23,6 +23,7 @@ If a user is a GitLab administrator they receive all permissions.
| Add tags | | | ✓ | ✓ | ✓ | | Add tags | | | ✓ | ✓ | ✓ |
| Write a wiki | | | ✓ | ✓ | ✓ | | Write a wiki | | | ✓ | ✓ | ✓ |
| Manage issue tracker | | | ✓ | ✓ | ✓ | | Manage issue tracker | | | ✓ | ✓ | ✓ |
| Manage labels | | | ✓ | ✓ | ✓ |
| Create new milestones | | | | ✓ | ✓ | | Create new milestones | | | | ✓ | ✓ |
| Add new team members | | | | ✓ | ✓ | | Add new team members | | | | ✓ | ✓ |
| Push to protected branches | | | | ✓ | ✓ | | Push to protected branches | | | | ✓ | ✓ |
......
...@@ -24,6 +24,7 @@ module API ...@@ -24,6 +24,7 @@ module API
# Example Request: # Example Request:
# POST /projects/:id/labels # POST /projects/:id/labels
post ':id/labels' do post ':id/labels' do
authorize! :admin_label, user_project
required_attributes! [:name, :color] required_attributes! [:name, :color]
attrs = attributes_for_keys [:name, :color] attrs = attributes_for_keys [:name, :color]
...@@ -51,6 +52,7 @@ module API ...@@ -51,6 +52,7 @@ module API
# Example Request: # Example Request:
# DELETE /projects/:id/labels # DELETE /projects/:id/labels
delete ':id/labels' do delete ':id/labels' do
authorize! :admin_label, user_project
required_attributes! [:name] required_attributes! [:name]
label = user_project.find_label(params[:name]) label = user_project.find_label(params[:name])
...@@ -71,6 +73,7 @@ module API ...@@ -71,6 +73,7 @@ module API
# Example Request: # Example Request:
# PUT /projects/:id/labels # PUT /projects/:id/labels
put ':id/labels' do put ':id/labels' do
authorize! :admin_label, user_project
required_attributes! [:name] required_attributes! [:name]
label = user_project.find_label(params[:name]) label = user_project.find_label(params[:name])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment