hughhhh commented on a change in pull request #16295:
URL: https://github.com/apache/superset/pull/16295#discussion_r692040824



##########
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:
       Yea these are the permissions that make the most sense since the + 
button is for writing (creating) and sqllab is the exception since there is a 
specific condition to view the sqllab interface.




-- 
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]

Reply via email to