diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IRegisterClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IRegisterClient.cs index 3a7d1466..4f24d72f 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IRegisterClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IRegisterClient.cs @@ -14,5 +14,5 @@ public interface IRegisterClient /// /// Party information /// - Task GetPartyForOrganization(string organizationNumber); + Task GetPartyForOrganization(string organizationNumber, CancellationToken cancellationToken = default); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IResourceRegistryClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IResourceRegistryClient.cs index 90b764a2..bdaf6576 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IResourceRegistryClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/IResourceRegistryClient.cs @@ -1,6 +1,8 @@ +using Altinn.Authentication.UI.Core.Common.Rights; + namespace Altinn.Authentication.UI.Core.SystemRegister; public interface IResourceRegistryClient { - Task GetResource(string resourceId, CancellationToken cancellationToken = default); + Task> GetResources(List rights, CancellationToken cancellationToken = default); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterClient.cs index 9bfb06bb..a68fa728 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterClient.cs @@ -4,6 +4,7 @@ namespace Altinn.Authentication.UI.Core.SystemRegister; public interface ISystemRegisterClient { - Task> GetListRegSys(CancellationToken cancellationToken = default); - Task> GetRightFromSystem(string systemId, CancellationToken cancellationToken); + Task> GetListRegSys(CancellationToken cancellationToken = default); + Task GetSystem(string systemId, CancellationToken cancellationToken = default); + Task> GetRightsFromSystem(string systemId, CancellationToken cancellationToken = default); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterService.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterService.cs index 92eccb57..ad17ae87 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterService.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/ISystemRegisterService.cs @@ -2,5 +2,6 @@ public interface ISystemRegisterService { - Task> GetListRegSys(CancellationToken cancellation = default); + Task> GetListRegSys(CancellationToken cancellation = default); + Task> GetSystemRights(string systemId, CancellationToken cancellationToken); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisterSystemResponse.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisterSystemResponse.cs deleted file mode 100644 index 3e8994fb..00000000 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisterSystemResponse.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Altinn.Authentication.UI.Core.Common.Rights; - -namespace Altinn.Authentication.UI.Core.SystemRegister -{ - /// - /// Model for the response of a registered system - /// A Registered System is a product supplied by a System Vendor, - /// it may need Rights to use or acccess Resources at a Service Provider. - /// - [ExcludeFromCodeCoverage] - public class RegisterSystemResponse - { - /// - /// The unique Id for this product, in human-readable string format. - /// The id is in the format of system_vendor_name_plus_name_chosen_by_them. - /// - /// An Optimistic Concurrency pattern to create new System Ids is used, - /// where the Id of the product is prefixed with the SystemVendor to help with uniqueness. - /// - /// When the SystemVendor tries to register a new system (product), - /// they should be aware of their own previous system names - /// when giving the new system it's id. - /// - [Required] - public string SystemId { get; set; } = string.Empty; - - /// - /// Organization number of the system Vendor that offers the product (system) - /// - [Required] - public string SystemVendorOrgNumber { get; set; } - - /// - /// Organization number of the system Vendor that offers the product (system) - /// - [Required] - public string SystemVendorOrgName { get; set; } = string.Empty; - - /// - /// A short name of the product, used when displaying to the user - /// - public required IDictionary Name { get; set; } - - /// - /// The array of Rights versus System Provider's Resources needed to use this Registered System - /// - public List Rights { get; set; } = []; - - /// - /// Registered Systems can be set to Soft Deleted - /// - public bool SoftDeleted { get; set; } = false; - - /// - /// The client Id - /// - [Required] - public List ClientId { get; set; } = []; - - /// - /// Registered systems can be set to false to hide it from the user interface. - /// This is used when the vendor does not want the user to create system users for specific systems - /// - public bool IsVisible { get; set; } = true; - - /// - /// White listing of redirect urls - /// - public List AllowedRedirectUrls { get; set; } = []; - } -} diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisteredSystemDTO.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisteredSystemDTO.cs new file mode 100644 index 00000000..20856c6f --- /dev/null +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RegisteredSystemDTO.cs @@ -0,0 +1,44 @@ +using System.Diagnostics.CodeAnalysis; +using Altinn.Authentication.UI.Core.Common.Rights; + +namespace Altinn.Authentication.UI.Core.SystemRegister +{ + /// + /// Model for the response of a registered system + /// A Registered System is a product supplied by a System Vendor, + /// it may need Rights to use or acccess Resources at a Service Provider. + /// + [ExcludeFromCodeCoverage] + public record class RegisteredSystemDTO + { + /// + /// A unique External Id for this System, in human-readable string format. + /// + public required string SystemId { get; set; } = string.Empty; + + /// + /// Organization number of the system Vendor that offers the product (system) + /// + public required string SystemVendorOrgNumber { get; set; } + + /// + /// Organization number of the system Vendor that offers the product (system) + /// + public string SystemVendorOrgName { get; set; } = string.Empty; + + /// + /// A short name of the product, used when displaying to the user + /// + public required IDictionary Name { get; set; } + + /// + /// A short description of the product, used when displaying to the user + /// + public required IDictionary Description { get; set; } + + /// + /// The array of Rights versus System Provider's Resources needed to use this Registered System + /// + public List Rights { get; set; } = []; + } +} diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RightFrontEnd.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RightFrontEnd.cs deleted file mode 100644 index 61c930ec..00000000 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/RightFrontEnd.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Altinn.Authentication.UI.Core.Common.Rights; - -namespace Altinn.Authentication.UI.Core.SystemRegister; - - -/// -/// Default Right on a Registered System, enriched with SystemOwner -/// -public class RightFrontEnd -{ - /// - /// The list of resources at the Service Provider which this Right is for. - /// - public List Resource { get; set; } = []; - - /// - /// The the full resource object of this Right. - /// - public ServiceResource? ServiceResource { get; set; } -} diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/SystemRegisterService.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/SystemRegisterService.cs index cd60ec8b..809bc48c 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/SystemRegisterService.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemRegister/SystemRegisterService.cs @@ -1,4 +1,6 @@ -namespace Altinn.Authentication.UI.Core.SystemRegister; +using Altinn.Authentication.UI.Core.Common.Rights; + +namespace Altinn.Authentication.UI.Core.SystemRegister; public class SystemRegisterService : ISystemRegisterService { @@ -16,28 +18,15 @@ public SystemRegisterService( _resourceRegistryClient = resourceRegistryClient; } - public async Task> GetListRegSys(CancellationToken cancellationToken) + public async Task> GetListRegSys(CancellationToken cancellationToken) { - List lista = []; - - lista = await _systemRegisterClient.GetListRegSys(cancellationToken ); - - foreach (RegisterSystemResponse response in lista) + List lista = await _systemRegisterClient.GetListRegSys(cancellationToken); + foreach (RegisteredSystemDTO response in lista) { - foreach (RightFrontEnd right in response.Rights) - { - string? resourceId = right.Resource.Find(x => x.Id == "urn:altinn:resource")?.Value; - - if (resourceId != null) - { - right.ServiceResource = await _resourceRegistryClient.GetResource(resourceId, cancellationToken); - } - } - try { response.SystemVendorOrgName = - (await _registerClient.GetPartyForOrganization(response.SystemVendorOrgNumber)).Organization.Name; + (await _registerClient.GetPartyForOrganization(response.SystemVendorOrgNumber, cancellationToken)).Organization.Name; } catch (Exception ex) { @@ -48,4 +37,10 @@ public async Task> GetListRegSys(CancellationToken return lista; } + + public async Task> GetSystemRights(string systemId, CancellationToken cancellationToken) + { + List right = await _systemRegisterClient.GetRightsFromSystem(systemId, cancellationToken); + return await _resourceRegistryClient.GetResources(right, cancellationToken); + } } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/RequestService.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/RequestService.cs index 5c828f10..b8a7e98b 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/RequestService.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/RequestService.cs @@ -1,4 +1,5 @@ -using Altinn.Authorization.ProblemDetails; +using Altinn.Authentication.UI.Core.SystemRegister; +using Altinn.Authorization.ProblemDetails; namespace Altinn.Authentication.UI.Core.SystemUsers; @@ -7,12 +8,42 @@ namespace Altinn.Authentication.UI.Core.SystemUsers; /// /// The client public class RequestService( - IRequestClient requestClient + IRequestClient requestClient, + IResourceRegistryClient resourceRegistryClient, + ISystemRegisterClient systemRegisterClient, + IRegisterClient registerClient ) : IRequestService { public async Task> GetVendorRequest(int partyId, Guid requestId, CancellationToken cancellationToken = default) { - return await requestClient.GetVendorRequest(partyId, requestId, cancellationToken); + Result request = await requestClient.GetVendorRequest(partyId, requestId, cancellationToken); + + if (request.Value != null) + { + // add resources + request.Value.Resources = await resourceRegistryClient.GetResources(request.Value.Rights, cancellationToken); + + // add system + RegisteredSystemDTO? system = await systemRegisterClient.GetSystem(request.Value.SystemId, cancellationToken); + request.Value.System = system; + + if (request.Value.System != null) + { + // add system name + try + { + request.Value.System.SystemVendorOrgName = + (await registerClient.GetPartyForOrganization(request.Value.System.SystemVendorOrgNumber, cancellationToken)).Organization.Name; + } + catch (Exception ex) + { + request.Value.System.SystemVendorOrgName = "N/A"; // "N/A" stands for "Not Available + Console.Write(ex.ToString()); + } + } + } + + return request; } public async Task> ApproveRequest(int partyId, Guid requestId, CancellationToken cancellationToken = default) diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUser.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUser.cs index da4f5802..c58611dd 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUser.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUser.cs @@ -1,6 +1,8 @@ using System.ComponentModel.DataAnnotations; using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; +using Altinn.Authentication.UI.Core.Common.Rights; +using Altinn.Authentication.UI.Core.SystemRegister; namespace Altinn.Authentication.UI.Core.SystemUsers; @@ -81,4 +83,16 @@ public class SystemUser /// [JsonPropertyName("supplierOrgno")] public string SupplierOrgNo { get; set; } = string.Empty; + + /// + /// List of rights for this systemuser + /// + [JsonPropertyName("rights")] + public List Rights { get; set; } = []; + + /// + /// List of resources information + /// + [JsonPropertyName("resources")] + public List Resources { get; set; } = []; } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUserService.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUserService.cs index af8c92e5..1f671319 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUserService.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/SystemUserService.cs @@ -15,15 +15,21 @@ public class SystemUserService : ISystemUserService private readonly ISystemUserClient _systemUserClient; private readonly IAccessManagementClient _accessManagementClient; private readonly ISystemRegisterClient _systemRegisterClient; + private readonly IRegisterClient _registerClient; + private readonly IResourceRegistryClient _resourceRegistryClient; public SystemUserService( ISystemUserClient systemUserClient, IAccessManagementClient accessManagementClient, - ISystemRegisterClient systemRegisterClient) + ISystemRegisterClient systemRegisterClient, + IRegisterClient registerClient, + IResourceRegistryClient resourceRegistryClient) { _systemUserClient = systemUserClient; _accessManagementClient = accessManagementClient; _systemRegisterClient = systemRegisterClient; + _registerClient = registerClient; + _resourceRegistryClient = resourceRegistryClient; } public async Task ChangeSystemUserDescription(string newDescr, Guid id, CancellationToken cancellationToken = default) @@ -48,12 +54,24 @@ public async Task> GetAllSystemUsersForParty(int id, Cancellati int reporteePartyId = reportee.PartyId; var lista = await _systemUserClient.GetSystemUserRealsForChosenUser(reporteePartyId, cancellationToken); + + foreach (SystemUser systemUser in lista) + { + await AddRights(systemUser, cancellationToken); + } + return lista; } public async Task GetSpecificSystemUserDTO(int partyId, Guid id, CancellationToken cancellationToken = default) { - return await _systemUserClient.GetSpecificSystemUserReal(partyId, id, cancellationToken); + SystemUser? systemUser = await _systemUserClient.GetSpecificSystemUserReal(partyId, id, cancellationToken); + if (systemUser != null) + { + await AddRights(systemUser, cancellationToken); + } + + return systemUser; } public async Task> CreateSystemUser(int partyId, CreateSystemUserRequestToAuthComp newSystemUserDescriptor, CancellationToken cancellation = default) @@ -82,7 +100,7 @@ public async Task ChangeSystemUserProduct(string selectedSystemType, Guid private async Task UserDelegationCheckForReportee(int partyId, string systemId ,CancellationToken cancellationToken = default) { - List rights = await _systemRegisterClient.GetRightFromSystem(systemId, cancellationToken); + List rights = await _systemRegisterClient.GetRightsFromSystem(systemId, cancellationToken); List rightResponsesList = []; foreach (Right right in rights) @@ -115,4 +133,27 @@ private static bool ResolveIfHasAccess(List rightRespons return true; } + + private async Task AddRights(SystemUser systemUser, CancellationToken cancellationToken) + { + + // TODO: rights for a systemuser is not 1:1 with system rights, but we have no way to + // get rights for a specific systemuser yet, so return the rights for the system for now. + List rights = await _systemRegisterClient.GetRightsFromSystem(systemUser.SystemId, cancellationToken); + + // add resources + systemUser.Resources = await _resourceRegistryClient.GetResources(rights, cancellationToken); + + // add system name + try + { + systemUser.SupplierName = + (await _registerClient.GetPartyForOrganization(systemUser.SupplierOrgNo, cancellationToken)).Organization.Name; + } + catch (Exception ex) + { + systemUser.SupplierName = "N/A"; // "N/A" stands for "Not Available + Console.Write(ex.ToString()); + } + } } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/VendorRequest.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/VendorRequest.cs index 1d0492ae..477a16f1 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/VendorRequest.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Core/SystemUsers/VendorRequest.cs @@ -1,4 +1,5 @@ using Altinn.Authentication.UI.Core.Common.Rights; +using Altinn.Authentication.UI.Core.SystemRegister; using System.ComponentModel.DataAnnotations; using System.Text.Json.Serialization; @@ -33,6 +34,12 @@ public class VendorRequest [JsonPropertyName("systemId")] public string SystemId { get; set; } + /// + /// Full system object + /// + [JsonPropertyName("system")] + public RegisteredSystemDTO? System { get; set; } + /// /// The organisation number for the SystemUser's Party ( the customer that delegates rights to the systemuser). /// Is one of the three parts of the External Request Id. @@ -47,7 +54,15 @@ public class VendorRequest /// [Required] [JsonPropertyName("rights")] - public List Rights { get; set; } + public List Rights { get; set; } = []; + + /// + /// The list of resources calculated from Rights. + /// Must be a minimum of 1 selected Right. + /// + [Required] + [JsonPropertyName("resources")] + public List Resources { get; set; } = []; /// /// Initially the request is "new", diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/RegisterClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/RegisterClient.cs index 582473fe..3eec5f71 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/RegisterClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/RegisterClient.cs @@ -52,7 +52,7 @@ public RegisterClient( } /// - public async Task GetPartyForOrganization(string organizationNumber) + public async Task GetPartyForOrganization(string organizationNumber, CancellationToken cancellationToken = default) { try { @@ -63,7 +63,7 @@ public async Task GetPartyForOrganization(string organizationNumber) StringContent requestContent = new(JsonSerializer.Serialize(new PartyLookup { OrgNo = organizationNumber}, _jsonSerializerOptions), Encoding.UTF8, "application/json"); HttpResponseMessage response = await _httpClient.PostAsync(token, endpointUrl, requestContent, accessToken); - string responseContent = await response.Content.ReadAsStringAsync(); + string responseContent = await response.Content.ReadAsStringAsync(cancellationToken); if (response.IsSuccessStatusCode) { diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/ResourceRegistryClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/ResourceRegistryClient.cs index 061d1b96..b9d4cace 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/ResourceRegistryClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/ResourceRegistryClient.cs @@ -4,6 +4,7 @@ using System.Text.Json; using Microsoft.Extensions.Options; using System.Net.Http.Json; +using Altinn.Authentication.UI.Core.Common.Rights; namespace Altinn.Authentication.UI.Integration.SystemRegister; @@ -25,7 +26,28 @@ public ResourceRegistryClient( _httpClient = httpClient; } - public async Task GetResource(string resourceId, CancellationToken cancellationToken = default) + public async Task> GetResources(List rights, CancellationToken cancellationToken = default) + { + List resources = []; + + foreach (Right right in rights) + { + string? resourceId = right.Resource.Find(x => x.Id == "urn:altinn:resource")?.Value; + + if (resourceId != null) + { + ServiceResource? serviceResource = await GetResource(resourceId, cancellationToken); + if (serviceResource != null) + { + resources.Add(serviceResource); + } + } + } + + return resources; + } + + private async Task GetResource(string resourceId, CancellationToken cancellationToken = default) { try { @@ -40,8 +62,6 @@ public ResourceRegistryClient( { return null; } - - } catch (Exception ex) { diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/SystemRegisterClient.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/SystemRegisterClient.cs index c38dba21..09c487d2 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/SystemRegisterClient.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Integration/SystemRegister/SystemRegisterClient.cs @@ -36,7 +36,7 @@ public SystemRegisterClient( _httpClient = httpClient; } - public async Task> GetListRegSys(CancellationToken cancellationToken = default) + public async Task> GetListRegSys(CancellationToken cancellationToken = default) { string token = JwtTokenUtil.GetTokenFromContext(_httpContextAccessor.HttpContext!, _platformSettings.JwtCookieName!)!; string endpointUrl = $"systemregister"; @@ -46,16 +46,32 @@ public async Task> GetListRegSys(CancellationToken if (response.IsSuccessStatusCode) { - return JsonSerializer.Deserialize> + return JsonSerializer.Deserialize> (await response.Content.ReadAsStringAsync(cancellationToken), _jsonSerializerOptions)!; } return []; } - public async Task> GetRightFromSystem(string systemId, CancellationToken cancellationToken) + public async Task GetSystem(string systemId, CancellationToken cancellationToken = default) { string token = JwtTokenUtil.GetTokenFromContext(_httpContextAccessor.HttpContext!, _platformSettings.JwtCookieName!)!; - string endpointUrl = $"systemregister/system/{systemId}/rights"; + string endpointUrl = $"systemregister/{systemId}"; + var accessToken = await _accessTokenProvider.GetAccessToken(); + + HttpResponseMessage response = await _httpClient.GetAsync(token, endpointUrl, accessToken); + + if (response.IsSuccessStatusCode) + { + return JsonSerializer.Deserialize(await response.Content.ReadAsStringAsync(cancellationToken), _jsonSerializerOptions)!; + } + return null; + } + + + public async Task> GetRightsFromSystem(string systemId, CancellationToken cancellationToken = default) + { + string token = JwtTokenUtil.GetTokenFromContext(_httpContextAccessor.HttpContext!, _platformSettings.JwtCookieName!)!; + string endpointUrl = $"systemregister/{systemId}/rights"; var accessToken = await _accessTokenProvider.GetAccessToken(); HttpResponseMessage response = await _httpClient.GetAsync(token, endpointUrl, accessToken); diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/RegisterClientMock.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/RegisterClientMock.cs index 1d87435c..5099ceec 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/RegisterClientMock.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/RegisterClientMock.cs @@ -4,7 +4,7 @@ namespace Altinn.Authentication.UI.Mocks.SystemRegister; public class RegisterClientMock : IRegisterClient { - public Task GetPartyForOrganization(string organizationNumber) + public Task GetPartyForOrganization(string organizationNumber, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/ResourceRegistryClientMock.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/ResourceRegistryClientMock.cs index f1024c91..881b7644 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/ResourceRegistryClientMock.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/ResourceRegistryClientMock.cs @@ -21,4 +21,9 @@ public async Task GetResource(string resourceId, CancellationTo { return await MockTestHelper(); } + + public Task> GetResources(List rights, CancellationToken cancellationToken = default) + { + throw new NotImplementedException(); + } } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/SystemRegisterClientMock.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/SystemRegisterClientMock.cs index 7bb175e3..4ba59d34 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/SystemRegisterClientMock.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Mocks/Mocks/SystemRegister/SystemRegisterClientMock.cs @@ -5,12 +5,19 @@ namespace Altinn.Authentication.UI.Mocks.SystemRegister; public class SystemRegisterClientMock : ISystemRegisterClient { - private static async Task> MockTestHelper() + private static async Task> MockTestHelper() { await Task.Delay(250); - RegisterSystemResponse regsys1 = new() + RegisteredSystemDTO regsys1 = new() { + SystemVendorOrgNumber = "314048431", + Description = new Dictionary + { + {"nb", "Kult system." }, + {"en", "Cool system." }, + {"nn", "Framifrå system." } + }, SystemId = "4human_hr_system_2024_2", SystemVendorOrgName = "4Human", Name = new Dictionary @@ -25,8 +32,15 @@ private static async Task> MockTestHelper() ] }; - RegisterSystemResponse regsys2 = new() + RegisteredSystemDTO regsys2 = new() { + SystemVendorOrgNumber = "314048432", + Description = new Dictionary + { + {"nb", "Kult system." }, + {"en", "Cool system." }, + {"nn", "Framifrå system." } + }, SystemId = "din_lokale_regnskapspartner", SystemVendorOrgName = "Din Lokale Regnskapspartner AS", Name = new Dictionary @@ -41,8 +55,15 @@ private static async Task> MockTestHelper() ] }; - RegisterSystemResponse regsys3 = new() + RegisteredSystemDTO regsys3 = new() { + SystemVendorOrgNumber = "314048433", + Description = new Dictionary + { + {"nb", "Kult system." }, + {"en", "Cool system." }, + {"nn", "Framifrå system." } + }, SystemId = "fiken_smabedrift", SystemVendorOrgName = "Fiken", Name = new Dictionary @@ -57,8 +78,15 @@ private static async Task> MockTestHelper() ] }; - RegisterSystemResponse regsys4 = new() + RegisteredSystemDTO regsys4 = new() { + SystemVendorOrgNumber = "314048434", + Description = new Dictionary + { + {"nb", "Kult system." }, + {"en", "Cool system." }, + {"nn", "Framifrå system." } + }, SystemId = "visma_mva_pakke", SystemVendorOrgName = "Visma", Name = new Dictionary @@ -73,8 +101,15 @@ private static async Task> MockTestHelper() }; - RegisterSystemResponse regsys5 = new() + RegisteredSystemDTO regsys5 = new() { + SystemVendorOrgNumber = "314048435", + Description = new Dictionary + { + {"nb", "Kult system." }, + {"en", "Cool system." }, + {"nn", "Framifrå system." } + }, SystemId = "visma_skatt_totalpakke", SystemVendorOrgName = "Visma", Name = new Dictionary @@ -89,7 +124,7 @@ private static async Task> MockTestHelper() ] }; - List theList = new() + List theList = new() { regsys1, regsys2, @@ -101,12 +136,17 @@ private static async Task> MockTestHelper() return theList; } - public async Task> GetListRegSys(CancellationToken cancellationToken) + public async Task> GetListRegSys(CancellationToken cancellationToken) { return await MockTestHelper(); } - public Task> GetRightFromSystem(string systemId, CancellationToken cancellationToken) + public Task> GetRightsFromSystem(string systemId, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } + + public Task GetSystem(string systemId, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Tests/Controllers/SystemRegisterControllerTest.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Tests/Controllers/SystemRegisterControllerTest.cs index 1485b6b1..3a9ecb0a 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Tests/Controllers/SystemRegisterControllerTest.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI.Tests/Controllers/SystemRegisterControllerTest.cs @@ -32,7 +32,7 @@ public async Task GetSystemTypeDTOList_ReturnsListOK() HttpResponseMessage response = await _client.SendAsync(request, HttpCompletionOption.ResponseContentRead); Assert.Equal(HttpStatusCode.OK, response.StatusCode); - List? list = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync(), jsonSerializerOptions); + List? list = JsonSerializer.Deserialize>(await response.Content.ReadAsStringAsync(), jsonSerializerOptions); Assert.True(list is not null && list.Count > 0); Assert.True(list[0].SystemId is not null); diff --git a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Controllers/SystemRegisterController.cs b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Controllers/SystemRegisterController.cs index 9a27a05d..647cc1b6 100644 --- a/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Controllers/SystemRegisterController.cs +++ b/bff/src/Altinn.Authentication.UI/Altinn.Authentication.UI/Controllers/SystemRegisterController.cs @@ -34,9 +34,24 @@ public SystemRegisterController(ISystemRegisterService systemRegisterService) [HttpGet] public async Task GetListOfRegisteredSystems(CancellationToken cancellationToken = default) { - List lista = [.. await _systemRegisterService.GetListRegSys(cancellationToken)]; + List lista = [.. await _systemRegisterService.GetListRegSys(cancellationToken)]; return Ok(lista); } + /// + /// Get rights for a single system + /// + /// + /// + /// + [Authorize] + [HttpGet("rights/{systemId}")] + public async Task GetSystemRights(string systemId, CancellationToken cancellationToken) + { + List rights = await _systemRegisterService.GetSystemRights(systemId, cancellationToken); + + return Ok(rights); + } + } diff --git a/frontend/src/components/RightsList/RightsList.tsx b/frontend/src/components/RightsList/RightsList.tsx index fa929ffe..23ea00bc 100644 --- a/frontend/src/components/RightsList/RightsList.tsx +++ b/frontend/src/components/RightsList/RightsList.tsx @@ -1,28 +1,26 @@ import React from 'react'; import { useTranslation } from 'react-i18next'; -import { SystemRight } from '@/types'; +import { ServiceResource } from '@/types'; import { ActionBar } from '../ActionBar'; import { i18nLanguageToShortLanguageCode } from '@/utils/languageUtils'; interface RightsListProps { - rights: SystemRight[]; + resources: ServiceResource[]; } -export const RightsList = ({ rights }: RightsListProps): React.ReactNode => { +export const RightsList = ({ resources }: RightsListProps): React.ReactNode => { const { i18n } = useTranslation(); const currentLanguage = i18nLanguageToShortLanguageCode(i18n.language); - return rights - .filter((productRight) => !!productRight.serviceResource) - .map((productRight) => { - return ( - - {productRight.serviceResource.description?.[currentLanguage]} - - ); - }); + return resources.map((resource) => { + return ( + + {resource.description?.[currentLanguage]} + + ); + }); }; diff --git a/frontend/src/components/SystemUserActionBar/SystemUserActionBar.tsx b/frontend/src/components/SystemUserActionBar/SystemUserActionBar.tsx index 94dc6594..0afa02fe 100644 --- a/frontend/src/components/SystemUserActionBar/SystemUserActionBar.tsx +++ b/frontend/src/components/SystemUserActionBar/SystemUserActionBar.tsx @@ -5,7 +5,6 @@ import { Heading, Link } from '@digdir/designsystemet-react'; import { ActionBar } from '../ActionBar'; import classes from './SystemUserActionBar.module.css'; import { PencilIcon } from '@navikt/aksel-icons'; -import { useGetVendorsQuery } from '@/rtk/features/systemUserApi'; import { SystemUser } from '@/types'; import { AuthenticationRoute } from '@/routes/paths'; import { url } from '@/utils/urlUtils'; @@ -22,14 +21,10 @@ export const SystemUserActionBar = ({ }: SystemUserActionBarProps): React.JSX.Element => { const { t } = useTranslation(); - const { data: vendors } = useGetVendorsQuery(); - - const vendor = vendors?.find((vendor) => vendor.systemId === systemUser.systemId); - return ( - {!vendor?.rights.length + {!systemUser?.resources.length ? t('authent_overviewpage.system_user_no_rights') : t('authent_overviewpage.system_rights_header')} @@ -48,7 +43,7 @@ export const SystemUserActionBar = ({ - + ); diff --git a/frontend/src/features/creationpage/CreationPageContent.tsx b/frontend/src/features/creationpage/CreationPageContent.tsx index 6279487a..286a0502 100644 --- a/frontend/src/features/creationpage/CreationPageContent.tsx +++ b/frontend/src/features/creationpage/CreationPageContent.tsx @@ -78,19 +78,17 @@ export const CreationPageContent = () => { }} value={selectedSystemType ? [selectedSystemType] : undefined} > - {vendors - ?.filter((vendor) => vendor.isVisible && !vendor.softDeleted) - .map((vendor) => { - return ( - - {vendor.name[currentLanguage]} - - ); - })} + {vendors?.map((vendor) => { + return ( + + {vendor.name[currentLanguage]} + + ); + })} {isLoadVendorError && ( {t('authent_creationpage.load_vendors_error')} diff --git a/frontend/src/features/detailpage/DetailPageContent.tsx b/frontend/src/features/detailpage/DetailPageContent.tsx index 07f63b54..883c12af 100644 --- a/frontend/src/features/detailpage/DetailPageContent.tsx +++ b/frontend/src/features/detailpage/DetailPageContent.tsx @@ -7,7 +7,6 @@ import classes from './DetailPage.module.css'; import { AuthenticationRoute } from '@/routes/paths'; import { useDeleteSystemuserMutation, - useGetVendorsQuery, useUpdateSystemuserMutation, } from '@/rtk/features/systemUserApi'; import { SystemUser } from '@/types'; @@ -27,9 +26,6 @@ export const DetailPageContent = ({ systemUser }: DetailPageContentProps) => { useDeleteSystemuserMutation(); const [updateSystemUser, { isError: isUpdateError, isLoading: isUpdatingSystemUser }] = useUpdateSystemuserMutation(); - const { data: vendors } = useGetVendorsQuery(); - - const vendor = vendors?.find((x) => systemUser.systemId === x.systemId); const [name, setName] = useState(systemUser.integrationTitle ?? ''); @@ -71,7 +67,7 @@ export const DetailPageContent = ({ systemUser }: DetailPageContentProps) => { {systemUser.integrationTitle || t('authent_detailpage.no_name')} - {vendor?.systemVendorOrgName?.toUpperCase()} + {systemUser.supplierName?.toUpperCase()} {IS_EDIT_NAME_ENABLED && ( diff --git a/frontend/src/features/rightsincludedpage/RightsIncludedPageContent.tsx b/frontend/src/features/rightsincludedpage/RightsIncludedPageContent.tsx index c9374481..f50848fa 100644 --- a/frontend/src/features/rightsincludedpage/RightsIncludedPageContent.tsx +++ b/frontend/src/features/rightsincludedpage/RightsIncludedPageContent.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next'; import { Alert, Button, Heading, Paragraph, Spinner } from '@digdir/designsystemet-react'; import { AuthenticationRoute } from '@/routes/paths'; import classes from './RightsIncludedPageContent.module.css'; -import { useCreateSystemUserMutation, useGetVendorsQuery } from '@/rtk/features/systemUserApi'; +import { useCreateSystemUserMutation, useGetSystemRightsQuery } from '@/rtk/features/systemUserApi'; import { useAppDispatch, useAppSelector } from '@/rtk/app/hooks'; import { useFirstRenderEffect } from '@/resources/hooks'; import { setCreatedId } from '@/rtk/features/createSystemUserSlice'; @@ -22,9 +22,11 @@ export const RightsIncludedPageContent = () => { const integrationTitle = useAppSelector((state) => state.createSystemUser.integrationTitle); const selectedSystemVendor = useAppSelector((state) => state.createSystemUser.selectedSystemType); - const { data: vendors } = useGetVendorsQuery(); - - const vendor = vendors?.find((x) => x.systemId === selectedSystemVendor); + const { + data: rights, + isLoading: isLoadingRights, + isError: isLoadRightsError, + } = useGetSystemRightsQuery(selectedSystemVendor); const navigate = useNavigate(); const dispatch = useAppDispatch(); @@ -61,31 +63,40 @@ export const RightsIncludedPageContent = () => { navigateToOverview(); }; + if (isLoadingRights) { + return ; + } + return ( - {vendor?.rights.length === 1 + {rights?.length === 1 ? t('authent_includedrightspage.sub_title_single') : t('authent_includedrightspage.sub_title')} - {vendor?.rights.length === 1 + {rights?.length === 1 ? t('authent_includedrightspage.content_text_single') : t('authent_includedrightspage.content_text')} - + {isCreateSystemUserError && ( {t('authent_includedrightspage.create_systemuser_error')} )} + {isLoadRightsError && ( + + {t('authent_includedrightspage.load_rights_error')} + + )} {isCreatingSystemUser && ( diff --git a/frontend/src/features/vendorRequestPage/VendorRequestPage.tsx b/frontend/src/features/vendorRequestPage/VendorRequestPage.tsx index 1d9ebd53..e0989d5b 100644 --- a/frontend/src/features/vendorRequestPage/VendorRequestPage.tsx +++ b/frontend/src/features/vendorRequestPage/VendorRequestPage.tsx @@ -5,9 +5,8 @@ import { VendorRequestPageContent } from './VendorRequestPageContent'; import AltinnLogo from '@/assets/AltinnLogoDefault.svg?react'; import classes from './VendorRequestPageContent.module.css'; import { useGetLoggedInUserQuery } from '@/rtk/features/userApi'; -import { useGetSystemUserRequestQuery, useGetVendorsQuery } from '@/rtk/features/systemUserApi'; +import { useGetSystemUserRequestQuery } from '@/rtk/features/systemUserApi'; import { useSearchParams } from 'react-router-dom'; -import { SystemRight } from '@/types'; export const VendorRequestPage = () => { const { t } = useTranslation(); @@ -28,16 +27,6 @@ export const VendorRequestPage = () => { skip: !requestId, }); - const { data: vendors } = useGetVendorsQuery(); - const system = vendors?.find((x) => x.systemId === creationRequest?.systemId); - const rightIds = - creationRequest?.rights.reduce((acc: string[], curr: SystemRight) => { - const resourceIds = curr.resource - .filter((x) => x.id === 'urn:altinn:resource') - .map((x) => x.value); - return [...acc, ...resourceIds]; - }, []) ?? []; - return ( @@ -53,7 +42,7 @@ export const VendorRequestPage = () => { {!requestId && ( {t('vendor_request.load_creation_request_no_id')} )} - {isLoadingCreationRequestError && ( + {(isLoadingCreationRequestError || (creationRequest && !creationRequest.system)) && ( {t('vendor_request.load_creation_request_error')} )} {isLoadUserInfoError && ( @@ -62,17 +51,8 @@ export const VendorRequestPage = () => { {(isLoadingUserInfo || isLoadingCreationRequest) && ( )} - {creationRequest && userInfo && system && ( - rightIds.indexOf(x.serviceResource?.identifier) > -1, - ), - }} - userInfo={userInfo} - /> + {creationRequest && creationRequest.system && userInfo && ( + )} diff --git a/frontend/src/features/vendorRequestPage/VendorRequestPageContent.tsx b/frontend/src/features/vendorRequestPage/VendorRequestPageContent.tsx index eb4f2ebf..06d5103c 100644 --- a/frontend/src/features/vendorRequestPage/VendorRequestPageContent.tsx +++ b/frontend/src/features/vendorRequestPage/VendorRequestPageContent.tsx @@ -158,11 +158,11 @@ export const VendorRequestPageContent = ({ request, userInfo }: VendorRequestPag - {request.rights.length === 1 + {request.resources.length === 1 ? t('vendor_request.rights_list_header_single') : t('vendor_request.rights_list_header')} - + {t('vendor_request.withdraw_consent_info')} diff --git a/frontend/src/localizations/en.json b/frontend/src/localizations/en.json index c8208b00..707d5432 100644 --- a/frontend/src/localizations/en.json +++ b/frontend/src/localizations/en.json @@ -46,6 +46,8 @@ "content_text_single": "This service is pre-selected by the vendor system.", "confirm_button": "Create system access", "create_systemuser_error": "Could not create system access", + "loading_rights": "Loading pre-selected services for vendor system", + "load_rights_error": "Could not load pre-selected services, or you do not have permission to delegate all these services.", "creating_systemuser": "Creating system access..." }, "authent_detailpage": { diff --git a/frontend/src/localizations/no_nb.json b/frontend/src/localizations/no_nb.json index 7496419a..4ce3c050 100644 --- a/frontend/src/localizations/no_nb.json +++ b/frontend/src/localizations/no_nb.json @@ -46,6 +46,8 @@ "content_text_single": "Denne tjenesten er forhåndsvalgt av fagsystemet.", "confirm_button": "Opprett systemtilgang", "create_systemuser_error": "Kunne ikke opprette systemtilgang", + "loading_rights": "Laster forhåndsvalgte tjenester for fagsystemet", + "load_rights_error": "Kunne ikke laste forhåndsvalgte tjenester, eller du har ikke rettigheter til å delegere alle disse tjenestene.", "creating_systemuser": "Oppretter systemtilgang..." }, "authent_detailpage": { diff --git a/frontend/src/localizations/no_nn.json b/frontend/src/localizations/no_nn.json index 8179b107..84894d7a 100644 --- a/frontend/src/localizations/no_nn.json +++ b/frontend/src/localizations/no_nn.json @@ -46,6 +46,8 @@ "content_text_single": "Denne tenesten er førehandsvald av fagsystemet.", "confirm_button": "Opprett systemtilgang", "create_systemuser_error": "Kunne ikkje oppretta systemtilgang", + "loading_rights": "Laster førehandsvalde tenester for fagsystemet", + "load_rights_error": "Kunne ikkje laste førehandsvalde tenester, eller du har ikkje rettighetar til å delegere alle desse tenestane.", "creating_systemuser": "Opprettar systemtilgang..." }, "authent_detailpage": { diff --git a/frontend/src/rtk/features/systemUserApi.ts b/frontend/src/rtk/features/systemUserApi.ts index c2ddd880..09f9e327 100644 --- a/frontend/src/rtk/features/systemUserApi.ts +++ b/frontend/src/rtk/features/systemUserApi.ts @@ -1,9 +1,10 @@ import { url } from '@/utils/urlUtils'; import { api } from './api'; -import { SystemUser, SystemUserCreationRequest, VendorSystem } from '@/types'; +import { ServiceResource, SystemUser, SystemUserCreationRequest, VendorSystem } from '@/types'; enum Tags { SystemUsers = 'Systemusers', + VendorSystems = 'VendorSystems', } interface CreationRequest { @@ -11,7 +12,7 @@ interface CreationRequest { selectedSystemType: string; } -const apiWithTag = api.enhanceEndpoints({ addTagTypes: [Tags.SystemUsers] }); +const apiWithTag = api.enhanceEndpoints({ addTagTypes: [Tags.SystemUsers, Tags.VendorSystems] }); export const systemUserApi = apiWithTag.injectEndpoints({ endpoints: (builder) => ({ @@ -21,10 +22,13 @@ export const systemUserApi = apiWithTag.injectEndpoints({ }), getSystemUser: builder.query({ query: (id) => url`systemuser/${id}`, - providesTags: [Tags.SystemUsers], }), getVendors: builder.query({ query: () => `/systemregister`, + providesTags: [Tags.VendorSystems], + }), + getSystemRights: builder.query({ + query: (systemId) => url`systemregister/rights/${systemId}`, }), createSystemUser: builder.mutation({ query: (systemUser) => ({ @@ -76,6 +80,7 @@ export const { useGetSystemUsersQuery, useUpdateSystemuserMutation, useGetVendorsQuery, + useGetSystemRightsQuery, useGetSystemUserRequestQuery, useApproveSystemUserRequestMutation, useRejectSystemUserRequestMutation, diff --git a/frontend/src/types/systemRight.ts b/frontend/src/types/systemRight.ts index 0ef7f01d..72983a3e 100644 --- a/frontend/src/types/systemRight.ts +++ b/frontend/src/types/systemRight.ts @@ -1,9 +1,6 @@ -import { ServiceResource } from './serviceResource'; - export interface SystemRight { resource: { id: string; value: string; }[]; - serviceResource: ServiceResource; } diff --git a/frontend/src/types/systemUser.ts b/frontend/src/types/systemUser.ts index 593847f9..5138c94d 100644 --- a/frontend/src/types/systemUser.ts +++ b/frontend/src/types/systemUser.ts @@ -1,3 +1,5 @@ +import { ServiceResource } from './serviceResource'; + export interface SystemUser { id: string; integrationTitle: string; @@ -5,6 +7,6 @@ export interface SystemUser { systemId: string; supplierName: string; supplierOrgno: string; - ownedByPartyId: string; created: string; + resources: ServiceResource[]; } diff --git a/frontend/src/types/systemUserCreationRequest.ts b/frontend/src/types/systemUserCreationRequest.ts index 90c5709f..a4968a03 100644 --- a/frontend/src/types/systemUserCreationRequest.ts +++ b/frontend/src/types/systemUserCreationRequest.ts @@ -1,3 +1,4 @@ +import { ServiceResource } from './serviceResource'; import { SystemRight } from './systemRight'; import { VendorSystem } from './vendorSystem'; @@ -9,5 +10,6 @@ export interface SystemUserCreationRequest { systemId: string; status: RequestStatus; rights: SystemRight[]; + resources: ServiceResource[]; redirectUrl?: string; } diff --git a/frontend/src/types/vendorSystem.ts b/frontend/src/types/vendorSystem.ts index 76c6073e..f949daf6 100644 --- a/frontend/src/types/vendorSystem.ts +++ b/frontend/src/types/vendorSystem.ts @@ -9,7 +9,10 @@ export interface VendorSystem { nn: string; en: string; }; + description?: { + nb: string; + nn: string; + en: string; + }; rights: SystemRight[]; - softDeleted: boolean; - isVisible: boolean; }