TeamPermissions.tsx 827 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import { Permissions } from 'app/core/components/AccessControl';
  3. import { contextSrv } from 'app/core/services/context_srv';
  4. import { AccessControlAction, Team } from '../../types';
  5. type TeamPermissionsProps = {
  6. team: Team;
  7. };
  8. // TeamPermissions component replaces TeamMembers component when the accesscontrol feature flag is set
  9. const TeamPermissions = (props: TeamPermissionsProps) => {
  10. const canSetPermissions = contextSrv.hasPermissionInMetadata(
  11. AccessControlAction.ActionTeamsPermissionsWrite,
  12. props.team
  13. );
  14. return (
  15. <Permissions
  16. title="Members"
  17. addPermissionTitle="Add member"
  18. buttonLabel="Add member"
  19. resource="teams"
  20. resourceId={props.team.id}
  21. canSetPermissions={canSetPermissions}
  22. />
  23. );
  24. };
  25. export default TeamPermissions;