superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From grace...@apache.org
Subject [incubator-superset] branch master updated: Allow alpha role import csv (#4164)
Date Mon, 08 Jan 2018 21:36:38 GMT
This is an automated email from the ASF dual-hosted git repository.

graceguo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 9364fb5  Allow alpha role import csv (#4164)
9364fb5 is described below

commit 9364fb5b79e1abef12b1d038542f61aac5e4ec7a
Author: timifasubaa <30888507+timifasubaa@users.noreply.github.com>
AuthorDate: Mon Jan 8 13:36:30 2018 -0800

    Allow alpha role import csv (#4164)
    
    * allow alphas upload csv
    
    * nits
---
 superset/security.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/superset/security.py b/superset/security.py
index 6c7d768..46283eb 100644
--- a/superset/security.py
+++ b/superset/security.py
@@ -39,6 +39,10 @@ ADMIN_ONLY_VIEW_MENUS = {
     '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
@@ -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):

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message