mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
* backend changes * frontend changes * linting * nit * import order * allow SA creator to access the SA page * fix merge * tests * fix frontend tests Co-authored-by: alexanderzobnin alexanderzobnin@gmail.com
29 lines
810 B
TypeScript
29 lines
810 B
TypeScript
import React from 'react';
|
|
|
|
import { Permissions } from 'app/core/components/AccessControl';
|
|
import { contextSrv } from 'app/core/services/context_srv';
|
|
|
|
import { AccessControlAction, ServiceAccountDTO } from '../../types';
|
|
|
|
type ServiceAccountPermissionsProps = {
|
|
serviceAccount: ServiceAccountDTO;
|
|
};
|
|
|
|
export const ServiceAccountPermissions = (props: ServiceAccountPermissionsProps) => {
|
|
const canSetPermissions = contextSrv.hasPermissionInMetadata(
|
|
AccessControlAction.ServiceAccountsPermissionsWrite,
|
|
props.serviceAccount
|
|
);
|
|
|
|
return (
|
|
<Permissions
|
|
title="Permissions"
|
|
addPermissionTitle="Add permission"
|
|
buttonLabel="Add permission"
|
|
resource="serviceaccounts"
|
|
resourceId={props.serviceAccount.id}
|
|
canSetPermissions={canSetPermissions}
|
|
/>
|
|
);
|
|
};
|