mauriciovigolo / keycloak-angular

Easy Keycloak setup for Angular applications.
MIT License
725 stars 278 forks source link

KeycloakService#getUserRoles() filter by resource #522

Closed daniel-shuy closed 10 months ago

daniel-shuy commented 11 months ago

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search for issues before submitting
- [x] feature request

Versions.

keycloak-angular: 14.1.0

Desired functionality.

Currently, KeycloakService#getUserRoles() returns resource roles for all resources, not just the current clientId, which can be problematic if there is another resource role used by another client that has the same name.

There is currently no way to filter the resource roles by the current clientId besides manually looping through each role and calling KeycloakService#isUserInRole(), which is very inefficient.

mauriciovigolo commented 10 months ago

Hi @daniel-shuy, this is a nice improvement. I will review and test your PR to include it in the next release. Thank you 😊

mauriciovigolo commented 10 months ago

Hey @daniel-shuy, your changes were included in https://github.com/mauriciovigolo/keycloak-angular/releases/tag/v15.0.0

Thank you for contributing! 🙂