Only people who can manage issue can assign labels to it

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-06-26 16:02:57 +02:00
parent c9f21c9691
commit 58ceb8e950
No known key found for this signature in database
GPG key ID: 161B5D6A44D3D88A

View file

@ -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(','))