GitHub user rushirao17 added a comment to the discussion: how to hide dashboard
[fullscreen] button
In our case, we needed to hide the Toggle Fullscreen button for non-admin users.
We did it by modifying the React code to include an isAdmin check, and then
rebuilding the Superset image.
File Location:
superset-frontend/src/dashboard/components/Header/useHeaderActionsDropdownMenu.tsx
const user = useSelector<any, UserWithPermissionsAndRoles | undefined>(
state => state.user,
);
const isAdmin = isUserAdmin(user);
// Modify following snippet
// Only show fullscreen option for admins, and only when not in edit or
embedded mode
if (isAdmin && !editMode && !isEmbedded) {
menuItems.push({
key: MenuKeys.ToggleFullscreen,
label: getUrlParam(URL_PARAMS.standalone)
? t('Exit fullscreen')
: t('Enter fullscreen'),
});
}
GitHub link:
https://github.com/apache/superset/discussions/25937#discussioncomment-14092293
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]