Base solution for your next web application
Open Closed

Reset tenant dashboard to default not working if no permission to a widget #11780


User avatar
0
rickfrankel created

We have a bunch of widgets defined for our tenant dashboard and most of them have permissionDependencies on them to control which of our tenants can see what widgets.

Our defaultTenantDashboard is configured to have all the tenant widgets available to them.

(All above setup in DashboardCustomisation.cs).

In the GetDefaultAngularTenantDashboardView() method we have setup the dashboard to include widgets that not all users will have access to. The permissions control which ones actually get displayed.

Now if a tenant tries to "Back to Default" or delete the last page on their dashboard. They will get an error if they do not have access to a particular widget that is defined in the GetDefaultAngularTenantDashboardView.

The error comes from the DashboardCustomisationAppService and in the SaveDashboardSettingForUser() method, which has been passed the GetDefaultDashboardValue from the DeletePage method.

In this case the dashboard that is passed into this method already has widgets on it that the user is not authorized to see and thus the check around allWidgetsOfDashboard.Any etc fails and we throw the UnknownWidgetId error.

Essentially because our DefaultAngularDashboard includes widgets that not all users will see in it and it is filtered out elsewhere we fail.

Could this please be looked into.

Thanks Rick


1 Answer(s)