diff --git a/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Integration/IIdentityUserIntegrationService.cs b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Integration/IIdentityUserIntegrationService.cs new file mode 100644 index 0000000000..e690b8bd0a --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Integration/IIdentityUserIntegrationService.cs @@ -0,0 +1,11 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Volo.Abp.Identity.Integration; + +[IntegrationService] +public interface IIdentityUserIntegrationService : IApplicationService +{ + Task GetRoleNamesAsync(Guid id); +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/Integration/IdentityUserIntegrationService.cs b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/Integration/IdentityUserIntegrationService.cs new file mode 100644 index 0000000000..5b95d40c9d --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/Integration/IdentityUserIntegrationService.cs @@ -0,0 +1,19 @@ +using System; +using System.Threading.Tasks; + +namespace Volo.Abp.Identity.Integration; + +public class IdentityUserIntegrationService : IdentityAppServiceBase, IIdentityUserIntegrationService +{ + protected IIdentityUserRepository UserRepository { get; } + + public IdentityUserIntegrationService(IIdentityUserRepository userRepository) + { + UserRepository = userRepository; + } + + public async Task GetRoleNamesAsync(Guid id) + { + return (await UserRepository.GetRoleNamesAsync(id)).ToArray(); + } +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IUserRoleFinder.cs b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IUserRoleFinder.cs index 31a865fc99..1835f38952 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IUserRoleFinder.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IUserRoleFinder.cs @@ -5,5 +5,8 @@ namespace Volo.Abp.Identity; public interface IUserRoleFinder { + [Obsolete("Use GetRoleNamesAsync instead.")] Task GetRolesAsync(Guid userId); + + Task GetRoleNamesAsync(Guid userId); } diff --git a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserRoleFinder.cs b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserRoleFinder.cs index ff19e61988..3ec1b2fbb1 100644 --- a/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserRoleFinder.cs +++ b/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserRoleFinder.cs @@ -13,8 +13,14 @@ public class UserRoleFinder : IUserRoleFinder, ITransientDependency IdentityUserRepository = identityUserRepository; } + [Obsolete("Use GetRoleNamesAsync instead.")] public virtual async Task GetRolesAsync(Guid userId) { return (await IdentityUserRepository.GetRoleNamesAsync(userId)).ToArray(); } + + public async Task GetRoleNamesAsync(Guid userId) + { + return (await IdentityUserRepository.GetRoleNamesAsync(userId)).ToArray(); + } } diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.Generated.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.Generated.cs new file mode 100644 index 0000000000..64279a8019 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.Generated.cs @@ -0,0 +1,65 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Abp.Identity; + +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IIdentityRoleAppService), typeof(IdentityRoleClientProxy))] +public partial class IdentityRoleClientProxy : ClientProxyBase, IIdentityRoleAppService +{ + public virtual async Task> GetAllListAsync() + { + return await RequestAsync>(nameof(GetAllListAsync)); + } + + public virtual async Task> GetListAsync(GetIdentityRolesInput input) + { + return await RequestAsync>(nameof(GetListAsync), new ClientProxyRequestTypeValue + { + { typeof(GetIdentityRolesInput), input } + }); + } + + public virtual async Task GetAsync(Guid id) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task CreateAsync(IdentityRoleCreateDto input) + { + return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue + { + { typeof(IdentityRoleCreateDto), input } + }); + } + + public virtual async Task UpdateAsync(Guid id, IdentityRoleUpdateDto input) + { + return await RequestAsync(nameof(UpdateAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id }, + { typeof(IdentityRoleUpdateDto), input } + }); + } + + public virtual async Task DeleteAsync(Guid id) + { + await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.cs new file mode 100644 index 0000000000..6e42400a96 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of IdentityRoleClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +public partial class IdentityRoleClientProxy +{ +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.Generated.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.Generated.cs new file mode 100644 index 0000000000..b6e18e1e0f --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.Generated.cs @@ -0,0 +1,98 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Abp.Identity; + +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IIdentityUserAppService), typeof(IdentityUserClientProxy))] +public partial class IdentityUserClientProxy : ClientProxyBase, IIdentityUserAppService +{ + public virtual async Task GetAsync(Guid id) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task> GetListAsync(GetIdentityUsersInput input) + { + return await RequestAsync>(nameof(GetListAsync), new ClientProxyRequestTypeValue + { + { typeof(GetIdentityUsersInput), input } + }); + } + + public virtual async Task CreateAsync(IdentityUserCreateDto input) + { + return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue + { + { typeof(IdentityUserCreateDto), input } + }); + } + + public virtual async Task UpdateAsync(Guid id, IdentityUserUpdateDto input) + { + return await RequestAsync(nameof(UpdateAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id }, + { typeof(IdentityUserUpdateDto), input } + }); + } + + public virtual async Task DeleteAsync(Guid id) + { + await RequestAsync(nameof(DeleteAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task> GetRolesAsync(Guid id) + { + return await RequestAsync>(nameof(GetRolesAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task> GetAssignableRolesAsync() + { + return await RequestAsync>(nameof(GetAssignableRolesAsync)); + } + + public virtual async Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input) + { + await RequestAsync(nameof(UpdateRolesAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id }, + { typeof(IdentityUserUpdateRolesDto), input } + }); + } + + public virtual async Task FindByUsernameAsync(string userName) + { + return await RequestAsync(nameof(FindByUsernameAsync), new ClientProxyRequestTypeValue + { + { typeof(string), userName } + }); + } + + public virtual async Task FindByEmailAsync(string email) + { + return await RequestAsync(nameof(FindByEmailAsync), new ClientProxyRequestTypeValue + { + { typeof(string), email } + }); + } +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.cs new file mode 100644 index 0000000000..8c40a7c313 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of IdentityUserClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +public partial class IdentityUserClientProxy +{ +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.Generated.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.Generated.cs new file mode 100644 index 0000000000..effdd5ef51 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.Generated.cs @@ -0,0 +1,52 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Abp.Identity; +using Volo.Abp.Users; + +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IIdentityUserLookupAppService), typeof(IdentityUserLookupClientProxy))] +public partial class IdentityUserLookupClientProxy : ClientProxyBase, IIdentityUserLookupAppService +{ + public virtual async Task FindByIdAsync(Guid id) + { + return await RequestAsync(nameof(FindByIdAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task FindByUserNameAsync(string userName) + { + return await RequestAsync(nameof(FindByUserNameAsync), new ClientProxyRequestTypeValue + { + { typeof(string), userName } + }); + } + + public virtual async Task> SearchAsync(UserLookupSearchInputDto input) + { + return await RequestAsync>(nameof(SearchAsync), new ClientProxyRequestTypeValue + { + { typeof(UserLookupSearchInputDto), input } + }); + } + + public virtual async Task GetCountAsync(UserLookupCountInputDto input) + { + return await RequestAsync(nameof(GetCountAsync), new ClientProxyRequestTypeValue + { + { typeof(UserLookupCountInputDto), input } + }); + } +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.cs new file mode 100644 index 0000000000..3d54f2d1bb --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of IdentityUserLookupClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity; + +public partial class IdentityUserLookupClientProxy +{ +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.Generated.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.Generated.cs new file mode 100644 index 0000000000..cc6ab0f7a9 --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.Generated.cs @@ -0,0 +1,28 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Client.ClientProxying; +using Volo.Abp.Http.Modeling; +using Volo.Abp.Identity.Integration; + +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity.Integration; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IIdentityUserIntegrationService), typeof(IdentityUserIntegrationClientProxy))] +[IntegrationService] +public partial class IdentityUserIntegrationClientProxy : ClientProxyBase, IIdentityUserIntegrationService +{ + public virtual async Task GetRoleNamesAsync(Guid id) + { + return await RequestAsync(nameof(GetRoleNamesAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.cs new file mode 100644 index 0000000000..2cca21f84a --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of IdentityUserIntegrationClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace Volo.Abp.Identity.Integration; + +public partial class IdentityUserIntegrationClientProxy +{ +} diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json index c082a7bda4..ce96b88ee9 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json @@ -7,10 +7,117 @@ "Volo.Abp.Identity.IdentityRoleController": { "controllerName": "IdentityRole", "controllerGroupName": "Role", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, "type": "Volo.Abp.Identity.IdentityRoleController", "interfaces": [ { - "type": "Volo.Abp.Identity.IIdentityRoleAppService" + "type": "Volo.Abp.Identity.IIdentityRoleAppService", + "name": "IIdentityRoleAppService", + "methods": [ + { + "name": "GetAllListAsync", + "parametersOnMethod": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + { + "name": "GetAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + { + "name": "GetListAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityRolesInput, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityRolesInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityRolesInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + { + "name": "CreateAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityRoleCreateDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityRoleCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + { + "name": "UpdateAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityRoleUpdateDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityRoleDto", + "typeSimple": "Volo.Abp.Identity.IdentityRoleDto" + } + }, + { + "name": "DeleteAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + ] } ], "actions": { @@ -275,10 +382,193 @@ "Volo.Abp.Identity.IdentityUserController": { "controllerName": "IdentityUser", "controllerGroupName": "User", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, "type": "Volo.Abp.Identity.IdentityUserController", "interfaces": [ { - "type": "Volo.Abp.Identity.IIdentityUserAppService" + "type": "Volo.Abp.Identity.IIdentityUserAppService", + "name": "IIdentityUserAppService", + "methods": [ + { + "name": "GetRolesAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + { + "name": "GetAssignableRolesAsync", + "parametersOnMethod": [], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + { + "name": "UpdateRolesAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserUpdateRolesDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateRolesDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + }, + { + "name": "FindByUsernameAsync", + "parametersOnMethod": [ + { + "name": "userName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + { + "name": "FindByEmailAsync", + "parametersOnMethod": [ + { + "name": "email", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + { + "name": "GetAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + { + "name": "GetListAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.GetIdentityUsersInput, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.GetIdentityUsersInput", + "typeSimple": "Volo.Abp.Identity.GetIdentityUsersInput", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.PagedResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto" + } + }, + { + "name": "CreateAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserCreateDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserCreateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + { + "name": "UpdateAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.IdentityUserUpdateDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.IdentityUserUpdateDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserUpdateDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Identity.IdentityUserDto", + "typeSimple": "Volo.Abp.Identity.IdentityUserDto" + } + }, + { + "name": "DeleteAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Void", + "typeSimple": "System.Void" + } + } + ] } ], "actions": { @@ -711,10 +1001,84 @@ "Volo.Abp.Identity.IdentityUserLookupController": { "controllerName": "IdentityUserLookup", "controllerGroupName": "UserLookup", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, "type": "Volo.Abp.Identity.IdentityUserLookupController", "interfaces": [ { - "type": "Volo.Abp.Identity.IIdentityUserLookupAppService" + "type": "Volo.Abp.Identity.IIdentityUserLookupAppService", + "name": "IIdentityUserLookupAppService", + "methods": [ + { + "name": "FindByIdAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Users.UserData", + "typeSimple": "Volo.Abp.Users.UserData" + } + }, + { + "name": "FindByUserNameAsync", + "parametersOnMethod": [ + { + "name": "userName", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Users.UserData", + "typeSimple": "Volo.Abp.Users.UserData" + } + }, + { + "name": "SearchAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UserLookupSearchInputDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.UserLookupSearchInputDto", + "typeSimple": "Volo.Abp.Identity.UserLookupSearchInputDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "Volo.Abp.Application.Dtos.ListResultDto", + "typeSimple": "Volo.Abp.Application.Dtos.ListResultDto" + } + }, + { + "name": "GetCountAsync", + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Identity.UserLookupCountInputDto, Volo.Abp.Identity.Application.Contracts", + "type": "Volo.Abp.Identity.UserLookupCountInputDto", + "typeSimple": "Volo.Abp.Identity.UserLookupCountInputDto", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.Int64", + "typeSimple": "number" + } + } + ] } ], "actions": { @@ -903,9 +1267,81 @@ "implementFrom": "Volo.Abp.Identity.IIdentityUserLookupAppService" } } + }, + "Volo.Abp.Identity.Integration.IdentityUserIntegrationController": { + "controllerName": "IdentityUserIntegration", + "controllerGroupName": "UserIntegration", + "isRemoteService": true, + "isIntegrationService": true, + "apiVersion": null, + "type": "Volo.Abp.Identity.Integration.IdentityUserIntegrationController", + "interfaces": [ + { + "type": "Volo.Abp.Identity.Integration.IIdentityUserIntegrationService", + "name": "IIdentityUserIntegrationService", + "methods": [ + { + "name": "GetRoleNamesAsync", + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "returnValue": { + "type": "System.String[]", + "typeSimple": "[string]" + } + } + ] + } + ], + "actions": { + "GetRoleNamesAsyncById": { + "uniqueName": "GetRoleNamesAsyncById", + "name": "GetRoleNamesAsync", + "httpMethod": "GET", + "url": "integration-api/identity/users/{id}/role-names", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String[]", + "typeSimple": "[string]" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Identity.Integration.IIdentityUserIntegrationService" + } + } } } } }, "types": {} -} +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientUserRoleFinder.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientUserRoleFinder.cs index b747b416c2..201c9f3eb0 100644 --- a/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientUserRoleFinder.cs +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientUserRoleFinder.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity.Integration; namespace Volo.Abp.Identity; @@ -9,15 +10,23 @@ namespace Volo.Abp.Identity; public class HttpClientUserRoleFinder : IUserRoleFinder, ITransientDependency { protected IIdentityUserAppService _userAppService { get; } + protected IIdentityUserIntegrationService _userIntegrationService { get; } - public HttpClientUserRoleFinder(IIdentityUserAppService userAppService) + public HttpClientUserRoleFinder(IIdentityUserAppService userAppService, IIdentityUserIntegrationService userIntegrationService) { _userAppService = userAppService; + _userIntegrationService = userIntegrationService; } + [Obsolete("Use GetRoleNamesAsync instead.")] public virtual async Task GetRolesAsync(Guid userId) { var output = await _userAppService.GetRolesAsync(userId); return output.Items.Select(r => r.Name).ToArray(); } + + public async Task GetRoleNamesAsync(Guid userId) + { + return await _userIntegrationService.GetRoleNamesAsync(userId); + } } diff --git a/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/Integration/IdentityUserIntegrationController.cs b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/Integration/IdentityUserIntegrationController.cs new file mode 100644 index 0000000000..3cb180e62b --- /dev/null +++ b/modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/Integration/IdentityUserIntegrationController.cs @@ -0,0 +1,27 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Volo.Abp.Identity.Integration; + +[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] +[Area(IdentityRemoteServiceConsts.ModuleName)] +[ControllerName("UserIntegration")] +[Route("integration-api/identity/users")] +public class IdentityUserIntegrationController : AbpControllerBase, IIdentityUserIntegrationService +{ + protected IIdentityUserIntegrationService UserIntegrationService { get; } + + public IdentityUserIntegrationController(IIdentityUserIntegrationService userIntegrationService) + { + UserIntegrationService = userIntegrationService; + } + + [HttpGet] + [Route("{id}/role-names")] + public virtual Task GetRoleNamesAsync(Guid id) + { + return UserIntegrationService.GetRoleNamesAsync(id); + } +} \ No newline at end of file diff --git a/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/AbpPermissionManagementDomainIdentityModule.cs b/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/AbpPermissionManagementDomainIdentityModule.cs index 924fbf4a36..e710d5b165 100644 --- a/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/AbpPermissionManagementDomainIdentityModule.cs +++ b/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/AbpPermissionManagementDomainIdentityModule.cs @@ -17,8 +17,8 @@ public class AbpPermissionManagementDomainIdentityModule : AbpModule options.ManagementProviders.Add(); options.ManagementProviders.Add(); - //TODO: Can we prevent duplication of permission names without breaking the design and making the system complicated - options.ProviderPolicies[UserPermissionValueProvider.ProviderName] = "AbpIdentity.Users.ManagePermissions"; + //TODO: Can we prevent duplication of permission names without breaking the design and making the system complicated + options.ProviderPolicies[UserPermissionValueProvider.ProviderName] = "AbpIdentity.Users.ManagePermissions"; options.ProviderPolicies[RolePermissionValueProvider.ProviderName] = "AbpIdentity.Roles.ManagePermissions"; }); } diff --git a/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RolePermissionManagementProvider.cs b/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RolePermissionManagementProvider.cs index a4a6cd60f2..b51110204a 100644 --- a/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RolePermissionManagementProvider.cs +++ b/modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RolePermissionManagementProvider.cs @@ -28,14 +28,14 @@ public class RolePermissionManagementProvider : PermissionManagementProvider UserRoleFinder = userRoleFinder; } - public override async Task CheckAsync(string name, string providerName, string providerKey) + public async override Task CheckAsync(string name, string providerName, string providerKey) { var multipleGrantInfo = await CheckAsync(new[] { name }, providerName, providerKey); return multipleGrantInfo.Result.Values.First(); } - public override async Task CheckAsync(string[] names, string providerName, string providerKey) + public async override Task CheckAsync(string[] names, string providerName, string providerKey) { var multiplePermissionValueProviderGrantInfo = new MultiplePermissionValueProviderGrantInfo(names); var permissionGrants = new List(); @@ -49,7 +49,7 @@ public class RolePermissionManagementProvider : PermissionManagementProvider if (providerName == UserPermissionValueProvider.ProviderName) { var userId = Guid.Parse(providerKey); - var roleNames = await UserRoleFinder.GetRolesAsync(userId); + var roleNames = await UserRoleFinder.GetRoleNamesAsync(userId); foreach (var roleName in roleNames) { diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.HttpApi/Volo/Abp/SettingManagement/TimeZoneSettingsController.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.HttpApi/Volo/Abp/SettingManagement/TimeZoneSettingsController.cs index 3a33db3462..b146987edc 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.HttpApi/Volo/Abp/SettingManagement/TimeZoneSettingsController.cs +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.HttpApi/Volo/Abp/SettingManagement/TimeZoneSettingsController.cs @@ -24,6 +24,7 @@ public class TimeZoneSettingsController : AbpControllerBase, ITimeZoneSettingsAp } [HttpGet] + [Route("timezones")] public Task> GetTimezonesAsync() { return _timeZoneSettingsAppService.GetTimezonesAsync();