Skip to content

Commit

Permalink
add perm for global db add
Browse files Browse the repository at this point in the history
  • Loading branch information
hughhhh committed Mar 4, 2022
1 parent 77063cc commit 2706935
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions superset-frontend/src/views/components/MenuRight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ const RightMenu = ({
const canSql = findPermission('can_sqllab', 'Superset', roles);
const canDashboard = findPermission('can_write', 'Dashboard', roles);
const canChart = findPermission('can_write', 'Chart', roles);
const showActionDropdown = canSql || canChart || canDashboard;
const canDatabase = findPermission('can_write', 'Database', roles);
const showActionDropdown = canSql || canChart || canDashboard || canDatabase;
const dropdownItems: MenuObjectProps[] = [
{
label: t('Data'),
Expand All @@ -94,12 +95,12 @@ const RightMenu = ({
{
label: t('Connect Database'),
name: GlobalMenuDataOptions.DB_CONNECTION,
perm: true,
perm: canDatabase,
},
{
label: t('Connect Google Sheet'),
name: GlobalMenuDataOptions.GOOGLE_SHEETS,
perm: HAS_GSHEETS_INSTALLED,
perm: canDatabase && HAS_GSHEETS_INSTALLED,
},
{
label: t('Upload a CSV'),
Expand Down

0 comments on commit 2706935

Please sign in to comment.