diff --git a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs index 5457d95358..1406a84305 100644 --- a/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs +++ b/src/marketplace/Apps.Service/BusinessLogic/AppsBusinessLogic.cs @@ -85,9 +85,9 @@ public IAsyncEnumerable GetAllActiveAppsAsync(string? languageShortName app.UseCaseNames)); /// - public IAsyncEnumerable GetAllUserUserBusinessAppsAsync(Guid companyId) => + public IAsyncEnumerable GetAllUserUserBusinessAppsAsync(Guid userId) => _portalRepositories.GetInstance() - .GetAllBusinessAppDataForUserIdAsync(companyId) + .GetAllBusinessAppDataForUserIdAsync(userId) .Select(x => new BusinessAppData( x.OfferId, diff --git a/src/marketplace/Apps.Service/BusinessLogic/IAppsBusinessLogic.cs b/src/marketplace/Apps.Service/BusinessLogic/IAppsBusinessLogic.cs index bf69e52ef0..eddfea0c13 100644 --- a/src/marketplace/Apps.Service/BusinessLogic/IAppsBusinessLogic.cs +++ b/src/marketplace/Apps.Service/BusinessLogic/IAppsBusinessLogic.cs @@ -41,9 +41,9 @@ public interface IAppsBusinessLogic /// /// Get all apps that a user has been assigned roles in. /// - /// Id of the user to get available apps for. + /// Id of the user to get available apps for. /// List of available apps for user. - public IAsyncEnumerable GetAllUserUserBusinessAppsAsync(Guid companyId); + public IAsyncEnumerable GetAllUserUserBusinessAppsAsync(Guid userId); /// /// Get detailed application data for a single app by id. diff --git a/src/marketplace/Apps.Service/Controllers/AppsController.cs b/src/marketplace/Apps.Service/Controllers/AppsController.cs index 4588c1e182..8cf4f58acf 100644 --- a/src/marketplace/Apps.Service/Controllers/AppsController.cs +++ b/src/marketplace/Apps.Service/Controllers/AppsController.cs @@ -74,11 +74,11 @@ public IAsyncEnumerable GetAllActiveAppsAsync([FromQuery] string? lang [HttpGet] [Route("business")] [Authorize(Roles = "view_apps")] - [Authorize(Policy = PolicyTypes.ValidCompany)] + [Authorize(Policy = PolicyTypes.CompanyUser)] [ProducesResponseType(typeof(IAsyncEnumerable), StatusCodes.Status200OK)] [ProducesResponseType(typeof(ErrorResponse), StatusCodes.Status400BadRequest)] public IAsyncEnumerable GetAllBusinessAppsForCurrentUserAsync() => - this.WithCompanyId(companyId => _appsBusinessLogic.GetAllUserUserBusinessAppsAsync(companyId)); + this.WithUserId(userId => _appsBusinessLogic.GetAllUserUserBusinessAppsAsync(userId)); /// /// Retrieves app details for an app referenced by id. diff --git a/tests/marketplace/Apps.Service.Tests/Controllers/AppsControllerTests.cs b/tests/marketplace/Apps.Service.Tests/Controllers/AppsControllerTests.cs index a318c9ff3e..5659085032 100644 --- a/tests/marketplace/Apps.Service.Tests/Controllers/AppsControllerTests.cs +++ b/tests/marketplace/Apps.Service.Tests/Controllers/AppsControllerTests.cs @@ -85,7 +85,7 @@ public async Task GetAllBusinessAppsForCurrentUserAsync_ReturnsExpectedCount() var result = await this._controller.GetAllBusinessAppsForCurrentUserAsync().ToListAsync().ConfigureAwait(false); //Assert - A.CallTo(() => _logic.GetAllUserUserBusinessAppsAsync(_identity.CompanyId)).MustHaveHappenedOnceExactly(); + A.CallTo(() => _logic.GetAllUserUserBusinessAppsAsync(_identity.UserId)).MustHaveHappenedOnceExactly(); result.Should().HaveCount(5); }