Only people who can manage issue can assign labels to it

Signed-off-by: NDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
上级 c9f21c96
...@@ -157,7 +157,7 @@ module API ...@@ -157,7 +157,7 @@ module API
if issue.valid? if issue.valid?
# Find or create labels and attach to issue. Labels are valid because # Find or create labels and attach to issue. Labels are valid because
# we already checked its name, so there can't be an error here # we already checked its name, so there can't be an error here
unless params[:labels].nil? if params[:labels] && can?(current_user, :admin_issue, user_project)
issue.remove_labels issue.remove_labels
# Create and add labels to the new created issue # Create and add labels to the new created issue
issue.add_labels_by_names(params[:labels].split(',')) issue.add_labels_by_names(params[:labels].split(','))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册