diff --git a/src/Api/Billing/Controllers/OrganizationBillingController.cs b/src/Api/Billing/Controllers/OrganizationBillingController.cs index f6ba87c71..b6a26f240 100644 --- a/src/Api/Billing/Controllers/OrganizationBillingController.cs +++ b/src/Api/Billing/Controllers/OrganizationBillingController.cs @@ -26,7 +26,7 @@ public class OrganizationBillingController( [HttpGet("metadata")] public async Task GetMetadataAsync([FromRoute] Guid organizationId) { - if (!await currentContext.AccessMembersTab(organizationId)) + if (!await currentContext.OrganizationUser(organizationId)) { return Error.Unauthorized(); } diff --git a/test/Api.Test/Billing/Controllers/OrganizationBillingControllerTests.cs b/test/Api.Test/Billing/Controllers/OrganizationBillingControllerTests.cs index 721685c28..51e374fd5 100644 --- a/test/Api.Test/Billing/Controllers/OrganizationBillingControllerTests.cs +++ b/test/Api.Test/Billing/Controllers/OrganizationBillingControllerTests.cs @@ -37,7 +37,7 @@ public class OrganizationBillingControllerTests Guid organizationId, SutProvider sutProvider) { - sutProvider.GetDependency().AccessMembersTab(organizationId).Returns(true); + sutProvider.GetDependency().OrganizationUser(organizationId).Returns(true); sutProvider.GetDependency().GetMetadata(organizationId).Returns((OrganizationMetadata)null); var result = await sutProvider.Sut.GetMetadataAsync(organizationId); @@ -50,7 +50,7 @@ public class OrganizationBillingControllerTests Guid organizationId, SutProvider sutProvider) { - sutProvider.GetDependency().AccessMembersTab(organizationId).Returns(true); + sutProvider.GetDependency().OrganizationUser(organizationId).Returns(true); sutProvider.GetDependency().GetMetadata(organizationId) .Returns(new OrganizationMetadata(true, true, true, true)); @@ -63,6 +63,7 @@ public class OrganizationBillingControllerTests Assert.True(response.IsEligibleForSelfHost); Assert.True(response.IsManaged); Assert.True(response.IsOnSecretsManagerStandalone); + Assert.True(response.IsSubscriptionUnpaid); } [Theory, BitAutoData]