2

I am working on Redmine 1.4.x. I have two roles: client and employee. To separate the roles I have added is_client boolean attribute to the database. Here is the use case:

if is_client?
  puts "it is client"
else
  puts "it is employee"
end

Now depending upon this role I have to display Portal tab in the top menu. To achieve this I tried the following:

Redmine::MenuManager.map :top_menu do |menu|
   menu.push :portal, "#", :html => {:id => "emp_portal", :onclick => "OpenEmployeePortal()"} , :if => (Proc.new { User.current.is_client? } && Proc.new { User.current.logged? })
end

But I couldn't succeed. It is showing the portal tab for both roles.

So how can I achieve this?

Montag451
  • 1,168
  • 3
  • 14
  • 30
user2622247
  • 1,059
  • 2
  • 15
  • 26

1 Answers1

4

Try this

Redmine::MenuManager.map :top_menu do |menu|
   menu.push :portal, "#", :html => {:id => "emp_portal", :onclick => "OpenEmployeePortal()"} , :if => (Proc.new { User.current.is_client? && User.current.logged? })
end
shrikant1712
  • 4,336
  • 1
  • 24
  • 42