Skip to content

Commit

Permalink
Find visible issues only in ContextMenusController#issues.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4580 e93f8b46-1217-0410-a6f0-8f06a7374b81
  • Loading branch information
jplang committed Dec 29, 2010
1 parent e9a0e6d commit d2cc286
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/controllers/context_menus_controller.rb
Expand Up @@ -2,7 +2,8 @@ class ContextMenusController < ApplicationController
helper :watchers

def issues
@issues = Issue.find_all_by_id(params[:ids], :include => :project)
@issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)

if (@issues.size == 1)
@issue = @issues.first
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
Expand Down
6 changes: 6 additions & 0 deletions test/functional/context_menus_controller_test.rb
Expand Up @@ -102,4 +102,10 @@ def test_context_menu_multiple_issues_of_different_projects
:class => 'icon-del' }
end

def test_context_menu_issue_visibility
get :issues, :ids => [1, 4]
assert_response :success
assert_template 'context_menu'
assert_equal [1], assigns(:issues).collect(&:id)
end
end

0 comments on commit d2cc286

Please sign in to comment.