maxrossello / redmine_extended_watchers

Grant additional issue and project view permissions to watcher users
GNU General Public License v3.0
44 stars 20 forks source link

Update extended_watchers_controller_patch.rb #3

Closed CodeInsider closed 11 years ago

CodeInsider commented 11 years ago

This does the same as the previous code but is a little bit easier. I removed the additional if, as you won't do anything if there is no user logged in. In addition, I chained your function calls.

I give the User.current.logged? condition a higher priority,as this is essential to your call in Issue.watched_by?, the other condition will be only checked if there is a currently logged in user.