Skip to content

Add user client role methods - #162

Merged
fschmtt merged 1 commit into
fschmtt:mainfrom
phillipfickl:users-client-roles
Sep 13, 2025
Merged

Add user client role methods#162
fschmtt merged 1 commit into
fschmtt:mainfrom
phillipfickl:users-client-roles

Conversation

@phillipfickl

Copy link
Copy Markdown
Contributor

This PR adds user client role mapping support to the Users resource.

List client roles for a user: Users::retrieveClientRoles($realm, $userId, $clientUuid)
List available client roles: Users::retrieveAvailableClientRoles($realm, $userId, $clientUuid)
Assign client roles to a user: Users::addClientRoles($realm, $userId, RoleCollection $roles, $clientUuid)
Remove client roles from a user: Users::removeClientRoles($realm, $userId, RoleCollection $roles, $clientUuid)

Used endpoints
GET /admin/realms/{realm}/users/{userId}/role-mappings/clients/{clientUuid}
GET /admin/realms/{realm}/users/{userId}/role-mappings/clients/{clientUuid}/available
POST /admin/realms/{realm}/users/{userId}/role-mappings/clients/{clientUuid}
DELETE /admin/realms/{realm}/users/{userId}/role-mappings/clients/{clientUuid}

@codecov

codecov Bot commented Sep 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.14%. Comparing base (70747c9) to head (9fdff6e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/Resource/Users.php 0.00% 46 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
- Coverage   99.18%   94.14%   -5.05%     
==========================================
  Files          27       27              
  Lines         859      905      +46     
==========================================
  Hits          852      852              
- Misses          7       53      +46     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fschmtt

fschmtt commented Sep 13, 2025

Copy link
Copy Markdown
Owner

Hey @phillipfickl thanks for your contribution! 🥳

@fschmtt
fschmtt merged commit a8d8687 into fschmtt:main Sep 13, 2025
11 of 13 checks passed
@phillipfickl
phillipfickl deleted the users-client-roles branch September 15, 2025 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants