Files
grafana/public/app/features/dashboard/components/DashboardPermissions/AccessControlDashboardPermissions.tsx
Karl Persson 817cf52744 Access control: Allow users with permission to update team, dashboard and folder permissions to list users in OSS (#48275)
* 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
2022-05-06 10:31:53 +02:00

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} />;
};