AccessControl: Let users with data source create permissions list non-core plugins (#48897)

* Only require create and permissions for new data source page

* Let users with permissions to create data sources list non-core plugins

* Keep the admin check as fallback when using rbac as well
This commit is contained in:
Karl Persson
2022-05-13 10:30:26 +02:00
committed by GitHub
parent 555867135b
commit 60bc3e4e5c
3 changed files with 8 additions and 6 deletions

View File

@@ -60,9 +60,7 @@ export class DataSourcesListPage extends PureComponent<Props> {
const { dataSources, dataSourcesCount, navModel, layoutMode, searchQuery, setDataSourcesSearchQuery, hasFetched } =
this.props;
const canCreateDataSource =
contextSrv.hasPermission(AccessControlAction.DataSourcesCreate) &&
contextSrv.hasPermission(AccessControlAction.DataSourcesWrite);
const canCreateDataSource = contextSrv.hasPermission(AccessControlAction.DataSourcesCreate);
const linkButton = {
href: 'datasources/new',