Browse Source

Merge pull request #16962 from abpframework/identity-integration-service

Introduce IdentityUserIntegrationService
pull/16964/head
Halil İbrahim Kalkan 3 years ago
committed by GitHub
parent
commit
fa585f0500
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      modules/identity/src/Volo.Abp.Identity.Application.Contracts/Volo/Abp/Identity/Integration/IIdentityUserIntegrationService.cs
  2. 19
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/Integration/IdentityUserIntegrationService.cs
  3. 3
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/IUserRoleFinder.cs
  4. 6
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/UserRoleFinder.cs
  5. 65
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.Generated.cs
  6. 7
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityRoleClientProxy.cs
  7. 98
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.Generated.cs
  8. 7
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserClientProxy.cs
  9. 52
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.Generated.cs
  10. 7
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/IdentityUserLookupClientProxy.cs
  11. 28
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.Generated.cs
  12. 7
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/Volo/Abp/Identity/Integration/IdentityUserIntegrationClientProxy.cs
  13. 444
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/ClientProxies/identity-generate-proxy.json
  14. 11
      modules/identity/src/Volo.Abp.Identity.HttpApi.Client/Volo/Abp/Identity/HttpClientUserRoleFinder.cs
  15. 27
      modules/identity/src/Volo.Abp.Identity.HttpApi/Volo/Abp/Identity/Integration/IdentityUserIntegrationController.cs
  16. 4
      modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/AbpPermissionManagementDomainIdentityModule.cs
  17. 6
      modules/identity/src/Volo.Abp.PermissionManagement.Domain.Identity/Volo/Abp/PermissionManagement/Identity/RolePermissionManagementProvider.cs
  18. 1
      modules/setting-management/src/Volo.Abp.SettingManagement.HttpApi/Volo/Abp/SettingManagement/TimeZoneSettingsController.cs

11
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<string[]> GetRoleNamesAsync(Guid id);
}

19
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<string[]> GetRoleNamesAsync(Guid id)
{
return (await UserRepository.GetRoleNamesAsync(id)).ToArray();
}
}

3
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<string[]> GetRolesAsync(Guid userId);
Task<string[]> GetRoleNamesAsync(Guid userId);
}

6
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<string[]> GetRolesAsync(Guid userId)
{
return (await IdentityUserRepository.GetRoleNamesAsync(userId)).ToArray();
}
public async Task<string[]> GetRoleNamesAsync(Guid userId)
{
return (await IdentityUserRepository.GetRoleNamesAsync(userId)).ToArray();
}
}

65
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>, IIdentityRoleAppService
{
public virtual async Task<ListResultDto<IdentityRoleDto>> GetAllListAsync()
{
return await RequestAsync<ListResultDto<IdentityRoleDto>>(nameof(GetAllListAsync));
}
public virtual async Task<PagedResultDto<IdentityRoleDto>> GetListAsync(GetIdentityRolesInput input)
{
return await RequestAsync<PagedResultDto<IdentityRoleDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(GetIdentityRolesInput), input }
});
}
public virtual async Task<IdentityRoleDto> GetAsync(Guid id)
{
return await RequestAsync<IdentityRoleDto>(nameof(GetAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), id }
});
}
public virtual async Task<IdentityRoleDto> CreateAsync(IdentityRoleCreateDto input)
{
return await RequestAsync<IdentityRoleDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue
{
{ typeof(IdentityRoleCreateDto), input }
});
}
public virtual async Task<IdentityRoleDto> UpdateAsync(Guid id, IdentityRoleUpdateDto input)
{
return await RequestAsync<IdentityRoleDto>(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 }
});
}
}

7
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
{
}

98
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>, IIdentityUserAppService
{
public virtual async Task<IdentityUserDto> GetAsync(Guid id)
{
return await RequestAsync<IdentityUserDto>(nameof(GetAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), id }
});
}
public virtual async Task<PagedResultDto<IdentityUserDto>> GetListAsync(GetIdentityUsersInput input)
{
return await RequestAsync<PagedResultDto<IdentityUserDto>>(nameof(GetListAsync), new ClientProxyRequestTypeValue
{
{ typeof(GetIdentityUsersInput), input }
});
}
public virtual async Task<IdentityUserDto> CreateAsync(IdentityUserCreateDto input)
{
return await RequestAsync<IdentityUserDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue
{
{ typeof(IdentityUserCreateDto), input }
});
}
public virtual async Task<IdentityUserDto> UpdateAsync(Guid id, IdentityUserUpdateDto input)
{
return await RequestAsync<IdentityUserDto>(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<ListResultDto<IdentityRoleDto>> GetRolesAsync(Guid id)
{
return await RequestAsync<ListResultDto<IdentityRoleDto>>(nameof(GetRolesAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), id }
});
}
public virtual async Task<ListResultDto<IdentityRoleDto>> GetAssignableRolesAsync()
{
return await RequestAsync<ListResultDto<IdentityRoleDto>>(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<IdentityUserDto> FindByUsernameAsync(string userName)
{
return await RequestAsync<IdentityUserDto>(nameof(FindByUsernameAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), userName }
});
}
public virtual async Task<IdentityUserDto> FindByEmailAsync(string email)
{
return await RequestAsync<IdentityUserDto>(nameof(FindByEmailAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), email }
});
}
}

7
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
{
}

52
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>, IIdentityUserLookupAppService
{
public virtual async Task<UserData> FindByIdAsync(Guid id)
{
return await RequestAsync<UserData>(nameof(FindByIdAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), id }
});
}
public virtual async Task<UserData> FindByUserNameAsync(string userName)
{
return await RequestAsync<UserData>(nameof(FindByUserNameAsync), new ClientProxyRequestTypeValue
{
{ typeof(string), userName }
});
}
public virtual async Task<ListResultDto<UserData>> SearchAsync(UserLookupSearchInputDto input)
{
return await RequestAsync<ListResultDto<UserData>>(nameof(SearchAsync), new ClientProxyRequestTypeValue
{
{ typeof(UserLookupSearchInputDto), input }
});
}
public virtual async Task<long> GetCountAsync(UserLookupCountInputDto input)
{
return await RequestAsync<long>(nameof(GetCountAsync), new ClientProxyRequestTypeValue
{
{ typeof(UserLookupCountInputDto), input }
});
}
}

7
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
{
}

28
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>, IIdentityUserIntegrationService
{
public virtual async Task<String[]> GetRoleNamesAsync(Guid id)
{
return await RequestAsync<String[]>(nameof(GetRoleNamesAsync), new ClientProxyRequestTypeValue
{
{ typeof(Guid), id }
});
}
}

7
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
{
}

444
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<Volo.Abp.Identity.IdentityRoleDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.Abp.Identity.IdentityRoleDto>"
}
},
{
"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<Volo.Abp.Identity.IdentityRoleDto>",
"typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto<Volo.Abp.Identity.IdentityRoleDto>"
}
},
{
"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<Volo.Abp.Identity.IdentityRoleDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.Abp.Identity.IdentityRoleDto>"
}
},
{
"name": "GetAssignableRolesAsync",
"parametersOnMethod": [],
"returnValue": {
"type": "Volo.Abp.Application.Dtos.ListResultDto<Volo.Abp.Identity.IdentityRoleDto>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.Abp.Identity.IdentityRoleDto>"
}
},
{
"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<Volo.Abp.Identity.IdentityUserDto>",
"typeSimple": "Volo.Abp.Application.Dtos.PagedResultDto<Volo.Abp.Identity.IdentityUserDto>"
}
},
{
"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<Volo.Abp.Users.UserData>",
"typeSimple": "Volo.Abp.Application.Dtos.ListResultDto<Volo.Abp.Users.UserData>"
}
},
{
"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": {}
}
}

11
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<string[]> GetRolesAsync(Guid userId)
{
var output = await _userAppService.GetRolesAsync(userId);
return output.Items.Select(r => r.Name).ToArray();
}
public async Task<string[]> GetRoleNamesAsync(Guid userId)
{
return await _userIntegrationService.GetRoleNamesAsync(userId);
}
}

27
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<string[]> GetRoleNamesAsync(Guid id)
{
return UserIntegrationService.GetRoleNamesAsync(id);
}
}

4
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<UserPermissionManagementProvider>();
options.ManagementProviders.Add<RolePermissionManagementProvider>();
//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";
});
}

6
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<PermissionValueProviderGrantInfo> CheckAsync(string name, string providerName, string providerKey)
public async override Task<PermissionValueProviderGrantInfo> CheckAsync(string name, string providerName, string providerKey)
{
var multipleGrantInfo = await CheckAsync(new[] { name }, providerName, providerKey);
return multipleGrantInfo.Result.Values.First();
}
public override async Task<MultiplePermissionValueProviderGrantInfo> CheckAsync(string[] names, string providerName, string providerKey)
public async override Task<MultiplePermissionValueProviderGrantInfo> CheckAsync(string[] names, string providerName, string providerKey)
{
var multiplePermissionValueProviderGrantInfo = new MultiplePermissionValueProviderGrantInfo(names);
var permissionGrants = new List<PermissionGrant>();
@ -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)
{

1
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<List<NameValue>> GetTimezonesAsync()
{
return _timeZoneSettingsAppService.GetTimezonesAsync();

Loading…
Cancel
Save