hughhhh commented on code in PR #20296:
URL: https://github.com/apache/superset/pull/20296#discussion_r892296614
##########
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:
datasource.owners objects will either have value || id set in the object. So
first i'm using map to create deconstruct the objects into a list of users ids
then checking if the current user id is in the array.
--
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]