I am sorry, but I have to reject this PR. That change is too complex and hard to maintain. The main reasons are:
- Scope is not always required and should not be enforced;
- Changing and later maintaining it in all the places, like plugins, would be an enormous amount of work;
PlaceholderGuarian
is not solving the problem but adding a fake scope (with the intention to fix later);- Most of the time, serialisation should be happening in the controller, and the scope will be added automatically.
Displaying a username or full name based on group is quite tricky. Instead of trying to merge it into core Discourse, can we start by creating a plugin? If your community is small, this is how it can work:
- Set
SiteSetting.enable_names
to false to always use username; - Define an endpoint that would return a map of username → full name for TL3 users;
- Use
formatUsername
API call to add full name or replace for TL3 users - discourse/app/assets/javascripts/discourse/app/lib/plugin-api.gjs at main · discourse/discourse · GitHub