if (kpi != null && currentPanel != null) {
// Check security constraints
PanelPermission panelPerm = PanelPermission.newInstance(currentPanel, PanelPermission.ACTION_VIEW);
SectionPermission sectionPerm = SectionPermission.newInstance(currentPanel, SectionPermission.ACTION_VIEW);
WorkspacePermission workspacePermission = WorkspacePermission.newInstance(currentPanel, WorkspacePermission.ACTION_LOGIN);
if (!userStatus.hasPermission(panelPerm) || !userStatus.hasPermission(sectionPerm) || !userStatus.hasPermission(workspacePermission)) {
// Forbidden access response
setResponse(new SendErrorResponse(HttpServletResponse.SC_FORBIDDEN));
}