AccessControlDashboardPermissions.tsx 582 B

1234567891011121314151617
  1. import React from 'react';
  2. import { Permissions } from 'app/core/components/AccessControl';
  3. import { contextSrv } from 'app/core/core';
  4. import { AccessControlAction } from 'app/types';
  5. import { DashboardModel } from '../../state';
  6. interface Props {
  7. dashboard: DashboardModel;
  8. }
  9. export const AccessControlDashboardPermissions = ({ dashboard }: Props) => {
  10. const canSetPermissions = contextSrv.hasPermission(AccessControlAction.DashboardsPermissionsWrite);
  11. return <Permissions resource={'dashboards'} resourceId={dashboard.uid} canSetPermissions={canSetPermissions} />;
  12. };