fix: enable admin to edit dataset in explore (#20613)

* add conditional

* add test

* fix lint
This commit is contained in:
Phillip Kelley-Dotson
2022-07-08 11:22:45 -07:00
committed by GitHub
parent 0ce0c6e1eb
commit e1a918f141
2 changed files with 24 additions and 4 deletions

View File

@@ -236,10 +236,9 @@ class DatasourceControl extends React.PureComponent {
const isSqlSupported = datasource.type === 'table';
const { user } = this.props;
const allowEdit = datasource.owners
?.map(o => o.id || o.value)
.includes(user.userId);
isUserAdmin(user);
const allowEdit =
datasource.owners?.map(o => o.id || o.value).includes(user.userId) ||
isUserAdmin(user);
const editText = t('Edit dataset');