*/
public static void checkNavigationContext(CoreAction action, ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
int navigationContext = action.getNavigationContext(mapping, form, request, response);
if (!ContextHolder.getContext().isSetupMode()) {
SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(request);
if ((navigationContext & info.getNavigationContext()) == 0) {
if ((navigationContext & SessionInfo.MANAGEMENT_CONSOLE_CONTEXT) != 0) {
if(!PolicyDatabaseFactory.getInstance().isAnyAccessRightAllowed(info.getUser(), true, true, false)) {
throw new NoPermissionException("You do not have permission to use the management console.");
}
info.setNavigationContext(SessionInfo.MANAGEMENT_CONSOLE_CONTEXT);
CoreUtil.resetMainNavigation(request.getSession());
} else if ((navigationContext & SessionInfo.USER_CONSOLE_CONTEXT) != 0) {
info.setNavigationContext(SessionInfo.USER_CONSOLE_CONTEXT);
CoreUtil.resetMainNavigation(request.getSession());
} else if ((navigationContext & SessionInfo.HELP_CONTEXT) != 0) {
// do nothing
} else {
throw new NoPermissionException("Action does not define any valid navigation contexts that it should be available in.");