How can I prevent manual access by typing a link to the deleted menu?

Hi,
I created a new cockpit application and deleted the “Data Explorer” button from the menu on the left.

Despite this, Users can access the “Data Explorer” page by typing a link in the address bar of the browser.

How do I prevent this situation?

Example: https://…/apps/cockpit-4/#/datapointexplorer

Hi,

If you have cloned the Cockpit application, you could remove the datapoint explorer plugin from your application. The plugin is imported in the ng1.ts file, because it is still written in AngularJS. Remove this import from the file:

import '@c8y/ng1-modules/cockpit-dataPointExplorerUI/cumulocity.json';

This will remove the datapoint explorer completely from your application, meaning from the global menu, but also from device detail pages.

Best regards



Christian Guether

2 Likes

Thanks for your reply and solution.

I followed what you wrote and successfully blocked access to “Data Explorer” via the link.

In addition;
I wanted to do the same blocking on the “Reports” button.
I also moved the “Reports” button away from the menu and then
From ng1.ts file import '@c8y/ng1-modules/cockpit-reports/cumulocity.json'; I deleted the partition.

But nothing worked.

As a solution;
in app.module.ts file

I made the “ReportDashboardModules” as a comment line as below.
and in this way, access to the “Reports” menu on the link was successfully blocked.

import {
  CockpitDashboardModule
  //ReportDashboardModule
  
} from '@c8y/ngx-components/context-dashboard';
@NgModule({
  imports: [
    // Upgrade module must be the first
    UpgradeModule,
    BrowserAnimationsModule,
    RouterModule.forRoot(),
	ReportsModule,
    NgRouterModule.forRoot([...UPGRADE_ROUTES], { enableTracing: false, useHash: true }),
    CoreModule.forRoot(),
    NgUpgradeModule,
    AssetsNavigatorModule,
    DashboardUpgradeModule,
    CockpitDashboardModule,
    SensorPhoneModule,
	//ReportDashboardModule,
    BinaryFileDownloadModule,
    SearchModule,
    SubAssetsModule,
    ChildDevicesModule,
    CockpitConfigModule,
    DatapointLibraryModule.forRoot(),
    WidgetsModule
  ]
})

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.