SAK-40535 Add User API methods for ContextualUserDisplayService #5932
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SAK-10868 and SAK-39642 added support for context-specific user aliases, that is a display name for a user that can be different in a specific site context.
This supports the "role play" or "user alias" use case, for example for simulation games (. There is a contrib implementation for this (https://confluence.sakaiproject.org/display/RPLAY/Home) in use by UCT and possibly others.
When implemented, it was sufficient to resolve the site context from the tool context, but as more tools have moved to using /direct/ or other REST endpoints for tool data, this no longer works as the tool placement is not available, specifically for chatData in the Chat Tool.
This task adds methods to the User API so that tool- and service endpoints can get a display name for a user for a specific site context explicitly.
This also allows us to remove explicit use of ContextualUserDisplayService in various tool code.
This PR adds the User API methods, updates implementations and mocks of User and adds support in the Chat tool code.