Open Closed

Angular Permission UI #674


User avatar
0
edelivery created
  • 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)
  • User Avatar
    0
    alper created
    Support Team Director

    In the microservice structure, we add Application.Contracts packages 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, and SettingManagement

    <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.

  • User Avatar
    0
    edelivery created

    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" ]
        },
    
  • User Avatar
    0
    edelivery created

    I found a way to fix this, but I don't know if it's the right way.

    In the GatewayModule, I have to add 1 line like below

    at this time, when I request /api/permission-management/, it won't route to anywhere else.

    Tell me if there is another best way to handle this.

    Thanks

  • User Avatar
    0
    hikalkan created
    Support Team Co-Founder

    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

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11