prachir1501 edited a comment on issue #15066:
URL: https://github.com/apache/superset/issues/15066#issuecomment-888453718
I have figured out a workaround as follows (for the charts) -
In the file
`superset/lib/python3.6/site-packages/superset/views/chart/views.py`,
we can modify the add function as follows-
This would make sure user only sees charts created by the user only
```
def add(self) -> FlaskResponse:
from flask import g
from superset.views.utils import bootstrap_user_data
temp = ConnectorRegistry.get_all_datasources(db.session)
temp2 = []
for d in temp:
if(str(d.created_by) == str(g.user)):
temp2.append(d)
datasources = [
{"value": str(d.id) + "__" + d.type, "label": repr(d)}
for d in temp2
]
payload = {
"datasources": sorted(datasources, key=lambda d: d["label"]),
"common": common_bootstrap_payload(),
"user": bootstrap_user_data(g.user),
}
return self.render_template(
"superset/add_slice.html", bootstrap_data=json.dumps(payload)
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]