Skip to content

Commit

Permalink
Allow alpha role import csv (apache#4164)
Browse files Browse the repository at this point in the history
* allow alphas upload csv

* nits
  • Loading branch information
timifasubaa authored and Grace Guo committed Jan 8, 2018
1 parent f38629b commit 07c3433
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion superset/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@
'UserDBModelView',
}

ALPHA_ONLY_VIEW_MENUS = {
'Upload a CSV',
}

ADMIN_ONLY_PERMISSIONS = {
'all_database_access',
'can_sql_json', # TODO: move can_sql_json to sql_lab role
Expand Down Expand Up @@ -117,7 +121,10 @@ def is_alpha_only(pvm):
if (pvm.view_menu.name in GAMMA_READ_ONLY_MODEL_VIEWS and
pvm.permission.name not in READ_ONLY_PERMISSION):
return True
return pvm.permission.name in ALPHA_ONLY_PERMISSIONS
return (
pvm.view_menu.name in ALPHA_ONLY_VIEW_MENUS or
pvm.permission.name in ALPHA_ONLY_PERMISSIONS
)


def is_admin_pvm(pvm):
Expand Down

0 comments on commit 07c3433

Please sign in to comment.