Skip to content

Commit

Permalink
[PM-14365][Defect] Member of trialing org cannot log in app (#4968)
Browse files Browse the repository at this point in the history
* decreased authorization level

Signed-off-by: Cy Okeke <[email protected]>

* Add some level of authorization

Signed-off-by: Cy Okeke <[email protected]>

* resolve the failing test

Signed-off-by: Cy Okeke <[email protected]>

* Resolve the failing test

Signed-off-by: Cy Okeke <[email protected]>

---------

Signed-off-by: Cy Okeke <[email protected]>
  • Loading branch information
cyprain-okeke authored Nov 4, 2024
1 parent df4f8df commit 96862b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class OrganizationBillingController(
[HttpGet("metadata")]
public async Task<IResult> GetMetadataAsync([FromRoute] Guid organizationId)
{
if (!await currentContext.AccessMembersTab(organizationId))
if (!await currentContext.OrganizationUser(organizationId))
{
return Error.Unauthorized();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public async Task GetMetadataAsync_MetadataNull_NotFound(
Guid organizationId,
SutProvider<OrganizationBillingController> sutProvider)
{
sutProvider.GetDependency<ICurrentContext>().AccessMembersTab(organizationId).Returns(true);
sutProvider.GetDependency<ICurrentContext>().OrganizationUser(organizationId).Returns(true);
sutProvider.GetDependency<IOrganizationBillingService>().GetMetadata(organizationId).Returns((OrganizationMetadata)null);

var result = await sutProvider.Sut.GetMetadataAsync(organizationId);
Expand All @@ -50,7 +50,7 @@ public async Task GetMetadataAsync_OK(
Guid organizationId,
SutProvider<OrganizationBillingController> sutProvider)
{
sutProvider.GetDependency<ICurrentContext>().AccessMembersTab(organizationId).Returns(true);
sutProvider.GetDependency<ICurrentContext>().OrganizationUser(organizationId).Returns(true);
sutProvider.GetDependency<IOrganizationBillingService>().GetMetadata(organizationId)
.Returns(new OrganizationMetadata(true, true, true, true));

Expand All @@ -63,6 +63,7 @@ public async Task GetMetadataAsync_OK(
Assert.True(response.IsEligibleForSelfHost);
Assert.True(response.IsManaged);
Assert.True(response.IsOnSecretsManagerStandalone);
Assert.True(response.IsSubscriptionUnpaid);
}

[Theory, BitAutoData]
Expand Down

0 comments on commit 96862b9

Please sign in to comment.