Commit 58ceb8e9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Only people who can manage issue can assign labels to it

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment