Open Marc-Andrieu opened 5 months ago
The problem is that if we add an admin API command for everything you can do on the CS-API, this quickly gets out of hand :-)
You can use the 'Login as a User' API to get an access token (ideally use the valid_until_ms
field so it expires), do the name change using the normal API and then log out the access token again.
Although this takes more steps (which could be scripted away), this is functionally the same.
Description:
Create an endpoint for the Admin API of Synapse, so that a server admin can change a user's nickname that is displayed in a given room only. (Or change the behavior of one which already exists)
Motivation:
In different spaces or channels, corresponding to different communities, one given user may play different roles. We may want to change automatically this user's nickname to match their role in each community (or allow an admin to do so manually), without accessing an access token of this user.
Why it should be easily added:
The feature exists, it's just about allowing a server admin to change other people's nicknames in rooms.
/myroomnick
on Element. Likewise for the global nickname using/nick
.PUT /_matrix/client/v3/rooms/<roomId>/state/m.room.member/<userId>
with a field"displayname"
in the request json. However, we should avoid getting an access token for the users' accounts.Current Contradictions:
PUT /_matrix/client/v3/profile/<userId>/displayname
PUT /_synapse/admin/v2/users/<userId>
Both with a field"displayname"
in the request json.