mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Remove banner when missing permissions to list users * For OSS allow users to list other users if they have permissions to write either team, dashboard or folder permissions
18 lines
582 B
TypeScript
18 lines
582 B
TypeScript
import React from 'react';
|
|
|
|
import { Permissions } from 'app/core/components/AccessControl';
|
|
import { contextSrv } from 'app/core/core';
|
|
import { AccessControlAction } from 'app/types';
|
|
|
|
import { DashboardModel } from '../../state';
|
|
|
|
interface Props {
|
|
dashboard: DashboardModel;
|
|
}
|
|
|
|
export const AccessControlDashboardPermissions = ({ dashboard }: Props) => {
|
|
const canSetPermissions = contextSrv.hasPermission(AccessControlAction.DashboardsPermissionsWrite);
|
|
|
|
return <Permissions resource={'dashboards'} resourceId={dashboard.uid} canSetPermissions={canSetPermissions} />;
|
|
};
|