unable to list dashboards created by gamma users
I have assigned access to specific data sources to Gamma role. Now Gamma users can view slices and dashboards associated with respective data sources. I have also assigned add/delete/edit on DashboardModelview and DashboardModelviewSync to gamma user. Now Gamma users can create a new dashboard from dashboard section in main menu.
Creation and/or listing of dashboard for gamma user fails if I try to create it using Slices-> select slice -> save query-> "Add to new dashboard"
case1 : click on save
I get message as dashboard is created successfully and given slice is added to it and will be redirected to new dashboard. But that dashboard is not visible in dashboards, even for adminuser. There isnt any error/warning displayed in caravel log for same.

case 2 : click on save & go to dashboard I am getting error as,
<error>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1988, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1641, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1544, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1639, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1625, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_appbuilder/security/decorators.py", line 26, in wraps
return f(self, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/caravel/views.py", line 1092, in dashboard
dashboard(dashboard_id=dash.id)
AttributeError: 'NoneType' object has no attribute 'id'
<error>
On any next action I am getting message as given dashboard was created but still not listed in dashboard view.

Though I can access those dashboards by manually copy pasting url,
e.g.
http://<server_name>:8088/caravel/explore/<data_source>/
Cannot reproduce on a recent master. User has these permissions:
[can this form get on ResetMyPasswordView, can this form post on ResetMyPasswordView,
can this form get on UserInfoEditView, can this form post on UserInfoEditView,
menu access on List Users, menu access on List Roles, can chart on UserStatsChartView,
menu access on User's Statistics, can list on PermissionModelView, menu access on Base Permissions,
can list on ViewMenuModelView, menu access on Views/Menus, can list on PermissionViewModelView,
menu access on Permission on Views/Menus, can show on TableColumnInlineView,
can list on TableColumnInlineView, can show on DruidColumnInlineView,
can list on DruidColumnInlineView, can show on SqlMetricInlineView, can list on SqlMetricInlineView,
can show on DruidMetricInlineView, can list on DruidMetricInlineView, can show on DatabaseView,
can list on DatabaseView, menu access on Databases, can show on TableModelView,
can list on TableModelView, menu access on Tables, can show on DruidClusterModelView,
can list on DruidClusterModelView, menu access on Druid Clusters, can show on SliceModelView,
can list on SliceModelView, menu access on Slices, can show on SliceAsync, can list on SliceAsync,
can show on DashboardModelView, can list on DashboardModelView, menu access on Dashboards,
can show on DashboardModelViewAsync, can list on DashboardModelViewAsync,
can show on LogModelView, can list on LogModelView, menu access on Action Log,
can show on DruidDatasourceModelView, can list on DruidDatasourceModelView,
menu access on Druid Datasources, can testconn on Caravel, can activity per day on Caravel,
can refresh datasources on Caravel, can save dash on Caravel, can select star on Caravel,
can table on Caravel, can dashboard on Caravel, can checkbox on Caravel,
can welcome on Caravel, can explore on Caravel, can sql on Caravel, can runsql on Caravel,
menu access on Refresh Druid Metadata, can show on CssTemplateModelView,
can list on CssTemplateModelView, menu access on CSS Templates, can add on SliceModelView,
can download on SliceModelView, can edit on SliceModelView, can delete on SliceModelView,
can add on DashboardModelView, can download on DashboardModelView,
can edit on DashboardModelView, can delete on DashboardModelView]
stpes to reproduce,
- install caravel, create admin
- init db, load samples
- create sample local user, add him to gamma role.
- assign list/add/delete/edit privileges to gamma role over DashboardModelview, DashboardModelviewSync
- login with sample user
- create dashboard
- list dashboards (list do not show any dashboard)
This is happening only in case of ldap user. So to correct step 3, login with ldap user with gamma role assigned.
any update ?
@ankitkailaswar don't assume someone is working on that
Notice: this issue has been closed because it has been inactive for 612 days. Feel free to comment and request for this issue to be reopened.
unable to view the chart what i have created with the Gamma role
you can use the below code and place this code under the views/core.py file. and Gamma user will be able to see his chart .
Class name is slicefilter
def apply(self, query, func): # noqa if security_manager.all_datasource_access(): return query perms = self.get_view_menus("datasource_access") Dash = models.Dashboard User = ab_models.User Slice = models.Slice # noqa
# TODO(bogdan): add `schema_access` support here
user_roles = [role.name.lower() for role in list(self.get_user_roles())]
datasource_perms = self.get_view_menus("datasource_access")
all_datasource_access = security_manager.all_datasource_access()
owner_ids_query = (
db.session.query(Slice.id)
.join(Slice.owners)
.filter(User.id == User.get_user_id())
)
query = query.filter(
or_(
Slice.id.in_(owner_ids_query),
)
)
return query
Let me know if you are facing any problem.. happy learning