unless User.current.allowed_to?(:add_issues, @issue.project, :global => true)
raise ::Unauthorized
end
+
call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
@issue.save_attachments(params[:attachments] || (params[:issue] && params[:issue][:uploads]))
if @issue.save
def update
return unless update_issue_from_params
+
@issue.save_attachments(params[:attachments] ||
(params[:issue] && params[:issue][:uploads]))
saved = false
def issue_tab
return render_error :status => 422 unless request.xhr?
+
tab = params[:name]
case tab
unless User.current.allowed_to?(:copy_issues, @projects)
raise ::Unauthorized
end
+
target_projects = @projects
if attributes['project_id'].present?
target_projects = Project.where(:id => attributes['project_id']).to_a
unless User.current.allowed_to?(:add_issues, target_projects)
raise ::Unauthorized
end
+
unless User.current.allowed_to?(:add_issue_watchers, @projects)
copy_watchers = false
end
unless User.current.allowed_to?(:copy_issues, @copy_from.project)
raise ::Unauthorized
end
+
@link_copy = link_copy?(params[:link_copy]) || request.get?
@copy_attachments = params[:copy_attachments].present? || request.get?
@copy_subtasks = params[:copy_subtasks].present? || request.get?