Open Closed

How to get check permission of another user not current user, in microService #6515


User avatar
0
bqabani created
  • ABP Framework version: v7.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes **Micro service **

I have a micro service (for example called Products Microservice) in that microservice I would like to check if a specific user has a permission, this user is not the current user, (I have his email only)

Kindly suggest all available solutions, the best solution that does not make me made connection to administration.

I think I need to use: var rs = await authorizationService.AuthorizeAsync(ClaimsPrincipal, requiredPolicy); but I do not have the (ClaimsPrincipal) and how can I get an instance of it related a specific user ? and is this good solution ?

Kindly advice


7 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can use IPermissionIntegrationService to check userId's permissions.

    public class IsGrantedRequest
    {
        public Guid UserId { get; set; }
    
        public string[] PermissionNames { get; set; }
    }
    
  • User Avatar
    0
    bqabani created

    Thank you for your prompt answer!

    Please provide me with more details, I cannot find IPermissionIntegrationService I searched for it all my solution, Not sure which dependency should I use,

    And finally Plaese provide with a blog or documentation reference for that is possible

    Thank you

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    This is an integrated app service from PermissionManagement.

    https://github.com/abpframework/abp/blob/dev/modules/permission-management/src/Volo.Abp.PermissionManagement.Application.Contracts/Volo/Abp/PermissionManagement/Integration/IPermissionIntegrationService.cs#L9

    You can use it to check the permissions. it exists on administration service.

    https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication

  • User Avatar
    0
    bqabani created

    The solution was to create a reference for identity service module (not the administration service module)

    using : https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Has your problem been solved? I see that you have closed this problem.

  • User Avatar
    0
    bqabani created

    Yes It was solved, Thank you

    The solution was to create a reference for identity service module (not the administration service module)

    using : https://docs.abp.io/en/commercial/latest/startup-templates/microservice/synchronous-interservice-communication

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07