Skip to content

Commit

Permalink
Add missing perms to sql_lab role
Browse files Browse the repository at this point in the history
The SQL Lab related role that is created programmatically is missing
permissions that make SQL Lab functional.
  • Loading branch information
mistercrunch committed Mar 29, 2018
1 parent 68dec24 commit 297300f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions superset/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,14 @@ def is_gamma_pvm(self, pvm):
self.is_alpha_only(pvm))

def is_sql_lab_pvm(self, pvm):
return pvm.view_menu.name in {'SQL Lab'} or pvm.permission.name in {
'can_sql_json', 'can_csv', 'can_search_queries',
}
return (
pvm.view_menu.name in {
'SQL Lab', 'SQL Editor', 'Query Search', 'Saved Queries',
} or
pvm.permission.name in {
'can_sql_json', 'can_csv', 'can_search_queries', 'can_sqllab_viz',
'can_sqllab',
})

def is_granter_pvm(self, pvm):
return pvm.permission.name in {
Expand Down

0 comments on commit 297300f

Please sign in to comment.