diff --git a/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx b/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx
index e3e4cc49391..1e6f0344865 100644
--- a/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx
+++ b/public/app/features/alerting/unified/components/contact-points/ContactPoints.test.tsx
@@ -154,6 +154,20 @@ describe('contact points', () => {
expect(await screen.findByText(/create contact point/i)).toBeInTheDocument();
});
+
+ test('defaults to contact points tab if user has only read permission', async () => {
+ grantUserPermissions([AccessControlAction.AlertingReceiversRead]);
+ renderWithProvider();
+
+ expect(await screen.findByText(/create contact point/i)).toBeInTheDocument();
+ });
+
+ test('defaults to contact points tab if user has only create permission', async () => {
+ grantUserPermissions([AccessControlAction.AlertingReceiversCreate]);
+ renderWithProvider();
+
+ expect(await screen.findByText(/create contact point/i)).toBeInTheDocument();
+ });
});
describe('templates tab', () => {
diff --git a/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx b/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx
index 0d37e6c9464..a9bbbf29845 100644
--- a/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx
+++ b/public/app/features/alerting/unified/components/contact-points/ContactPoints.tsx
@@ -196,9 +196,12 @@ const useTabQueryParam = (defaultTab: ActiveTab) => {
export const ContactPointsPageContents = () => {
const { selectedAlertmanager } = useAlertmanager();
- const [, showContactPointsTab] = useAlertmanagerAbility(AlertmanagerAction.ViewContactPoint);
+ const [, canViewContactPoints] = useAlertmanagerAbility(AlertmanagerAction.ViewContactPoint);
+ const [, canCreateContactPoints] = useAlertmanagerAbility(AlertmanagerAction.CreateContactPoint);
const [, showTemplatesTab] = useAlertmanagerAbility(AlertmanagerAction.ViewNotificationTemplate);
+ const showContactPointsTab = canViewContactPoints || canCreateContactPoints;
+
// Depending on permissions, user may not have access to all tabs,
// but we can default to picking the first one that they definitely _do_ have access to
const defaultTab = [