access.tsx 476 B

12345678910111213141516
  1. import {useMemo} from 'react';
  2. import {hasEveryAccess} from 'sentry/components/acl/access';
  3. import type {Scope} from 'sentry/types/core';
  4. import useOrganization from 'sentry/utils/useOrganization';
  5. const DYNAMIC_SAMPLING_WRITE_ACCESS: Scope[] = ['org:write'];
  6. export function useHasDynamicSamplingWriteAccess() {
  7. const organization = useOrganization();
  8. return useMemo(
  9. () => hasEveryAccess(DYNAMIC_SAMPLING_WRITE_ACCESS, {organization}),
  10. [organization]
  11. );
  12. }