Hi,
TLDR;
What’s the best way to know whether a user is allowed to edit the view/widget settings in a board or dashboard?
Details
We have an app that has a widget and view feature in which the user can configure the widget/view within our app (not using the monday configuration/settings).
We want to avoid that users without the necessary permissions are able to change the settings, therefor we need to know if the user has the required (dash)board permissions.
For a dashboard this means the user needs to be dashboard owner.
And for a board this means that any user can make changes unless the board permissions are being restricted to either “Only edit items or subitems that users are assigned to” or “Write updates on items only”, in which case only the board owner should be able to make changes to the widget(s)/board views.
We’ve found a variable in the context called editMode
which works as expected for a Dashboard. In this case it will only return true
for dashboard owners and false for everyone else. Unfortunately for a view and widget in the context of a board this always returns false
, even for board owners.
If were to be able to figure out whether our widget is being used on a board or dashboard we could use the editMode
prop for dashboards and use the API to figure out the permissions (and if necessary board owners) for a board.
But even that difference is unclear based on the data in the context.
Any thoughts?
Best,
Maarten