Hi, I have implemented a custom widget into our custom cockpit. This widget is attached to the device-level dashboard, it does not appear under the “Add Widget” library.
This widget is hardcoded and acts like a dashboard whenever the user clicks or navigates to the device level. However, since this is not an actual dashboard but a hardcoded widget acting as one—and it does not have a managed object—how can I apply the same access control global role to this widget as is applied to dashboards?
Please refer to the attached screenshot. Here, I have added this widget as a dashboard. To get the global role access, I added the edit header of the dashboard into this widget, but it doesn’t seem to be working. Also, the “Add Widget” section appears below my widget, whereas I only need the edit functionality so that I can have global role access.
The code I have added to make this work
ContextDashboardModule - in module file
<c8y-context-dashboard
name=“example-widget”
[canDelete]=“false”
Thanks for the reply, we use canActivate for conditioning logic. but we are looking to also have the same UI not hardcoded canActivate condition. Is this something possible for adding the global role in my dashboard widget?
The components used for this dialog are really specific to storing this information on the dashboards managedObject. Since you do not have these, you would need to implement this on your own and probably also need to find a location where you would store this setting.
This depends on your usecase.. Is this a setting that should be stored once per tenant, per device or per dashboard? Who should be allowed to change this setting?
as said, these views are specific to storing the information on the dashboard managedObject.. Your usecase seems to be having a static dashboard, so you are not going to have a dashboard managedObject. Therefore you would need to implement this on your own.