AAfghahi commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r891576024
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
don't think this is the right way of doing it though.
##########
superset-frontend/src/explore/components/controls/DatasourceControl/index.jsx:
##########
@@ -200,7 +200,8 @@ class DatasourceControl extends React.PureComponent {
const { user } = this.props;
const allowEdit =
datasource.owners.map(o => o.id).includes(user.userId) ||
- isUserAdmin(user);
+ datasource.owners.map(o => o.value).includes(user.userId);
Review Comment:
couldn't you write this in without the ||
`o => o.id || o.value == user.userId `
--
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]