- ABP Framework version: v3.3.0
- UI type: Angular
- Tiered (MVC) or Identity Server Seperated (Angular): yes
My solution is using Microservice so it have seperated Modules and it communicated by gateway. How can i included all permission of all modules to Permisssion management. Because my gateway Route to /api/permission-management of only 1 module
{
"downstreampathtemplate": "/api/permission-management/{everything}",
"downstreamscheme": "https",
"downstreamhostandports": [
{
"host": "localhost",
"port": 44325
}
],
"upstreampathtemplate": "/api/permission-management/{everything}",
"upstreamhttpmethod": [ "put", "delete", "get", "post" ]
},
4 Answer(s)
-
0
In the microservice structure, we add
Application.Contractspackages of all modules to the gateway. Thus, all permissions can be available and we can get them from the gateway.For example, In the microservice demo application, the BackendAdminAppGateway.Host project has references
https://github.com/abpframework/abp-samples/blob/master/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGateway.Host.csproj
In this project you can see Application.Contracts of Blogging and ProductManagement module are added.
<PackageReference Include="Volo.Blogging.Application.Contracts" Version="3.2.1" /> <ProjectReference Include="..\..\modules\product\src\ProductManagement.HttpApi\ProductManagement.HttpApi.csproj" />Also essential references of the other cross-cutting featured projects are added. Eg:
PermissionManagement,FeatureManagement, andSettingManagement<PackageReference Include="Volo.Abp.PermissionManagement.Domain.Identity" Version="3.2.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Domain.IdentityServer" Version="3.2.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.Application" Version="3.2.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.HttpApi" Version="3.2.1" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="3.2.1" />So the gateway does not route the permission request but sends its own.
Check out Microservice Demo document.
You can also set up a seperate microservice for only Permission Management but it will be unncessary as it's not a part of the business logic.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi alper I added Application.Contracts of another module to gateway but it still load permission of 1 module. when I removed the Ocelot route in appsettings, i've got an Error 404 when call the api. I think that's because route of gateway access to that module my routing in appsetting gateway:
{ "downstreampathtemplate": "/api/permission-management/{everything}", "downstreamscheme": "https", "downstreamhostandports": [ { "host": "localhost", "port": 44325 } ], "upstreampathtemplate": "/api/permission-management/{everything}", "upstreamhttpmethod": [ "put", "delete", "get", "post" ] },Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
-
0
Yes, we did same for the Microservice example solution:
https://github.com/abpframework/abp-samples/blob/master/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs#L125-L137
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
