Make sure user can not watch what he is not allowed to view.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3170 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-12-13 14:48:28 +00:00
parent bb477a3a0f
commit 9a452a5c35
2 changed files with 14 additions and 1 deletions
+5 -1
View File
@@ -25,7 +25,11 @@ class WatchersController < ApplicationController
:render => { :nothing => true, :status => :method_not_allowed }
def watch
set_watcher(User.current, true)
if @watched.respond_to?(:visible?) && !@watched.visible?(User.current)
render_403
else
set_watcher(User.current, true)
end
end
def unwatch