Skip to content
代码片段 群组 项目
提交 cb33279a 编辑于 作者: Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
浏览文件

Merge branch 'label-permissions' into 'master'

Label permissions

* Update label permission docs
* Add authorisation to labels via API

See merge request !1020
No related branches found
No related tags found
无相关合并请求
......@@ -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 | | | | ✓ | ✓ |
......
......@@ -24,6 +24,7 @@ class Labels < Grape::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 @@ class Labels < Grape::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 @@ class Labels < Grape::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])
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册