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?

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.