pkdotson commented on a change in pull request #16295:
URL: https://github.com/apache/superset/pull/16295#discussion_r691531897
##########
File path: superset-frontend/src/components/Menu/MenuRight.tsx
##########
@@ -21,24 +21,44 @@ import { MainNav as Menu } from 'src/common/components';
import { t, styled, css, SupersetTheme } from '@superset-ui/core';
import { Link } from 'react-router-dom';
import Icons from 'src/components/Icons';
+import findPermission from 'src/dashboard/util/findPermission';
import LanguagePicker from './LanguagePicker';
import { NavBarProps, MenuObjectProps } from './Menu';
+const appContainer = document.getElementById('app') || '{}';
+const bootstrapData = JSON.parse(appContainer.getAttribute('data-bootstrap'));
+console.log('userRoles', bootstrapData.user.roles);
+
+const { roles } = bootstrapData.user;
+console.log(findPermission('can_dashboard', 'Superset', roles));
+console.log(findPermission('can_sqllab', 'Superset', roles));
+console.log(findPermission('can_slice', 'Superset', roles));
+
+const canChart = findPermission('can_write', 'Chart', roles);
+const canSql = findPermission('can_sqllab', 'Superset', roles);
+const canDashboard = findPermission('can_write', 'Dashboard', roles);
Review comment:
Are these permissions to check whether user actually create chart,
dashboard and write queries?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]