Project

General

Profile

Patch #12721 ยป menu-manager-optimize.patch

Daniel Ritz, 2013-01-03 14:45

View differences:

lib/redmine/menu_manager.rb
# Checks if a user is allowed to access the menu item by:
#
# * Checking the conditions of the item
# * Checking the url target (project only)
# * Checking the conditions of the item
def allowed_node?(node, user, project)
if project && user && !user.allowed_to?(node.url, project)
return false
end
if node.condition && !node.condition.call(project)
# Condition that doesn't pass
return false
end
if project
return user && user.allowed_to?(node.url, project)
else
# outside a project, all menu items allowed
return true
end
return true
end
end
    (1-1/1)