How to add a link in the Redmine menu only to logged in users?

2

I've created a link, at the top of Redmine, for a particular industry. I need to know how to hide this link if there is no user logged in.

The button was created in the init.rb file of my plugin containing the following syntax ...

menu :top_menu, :my_link, { :controller => 'my_controller', :action => 'index' },
     :last => true,  :caption => :my_caption

I tried to use User.current.logged? but I was not successful.

    
asked by anonymous 14.03.2014 / 15:11

1 answer

3

Do this:

menu :top_menu, :my_link, {:controller => 'my_controller', :action => 'index'},
     :caption => :my_caption, :if => Proc.new { User.current.logged? }

Reference: link

    
14.03.2014 / 15:22