Currently software abuses /whois for checking admin state, though in some cases this is not useful because /whois will return a result if the requesting user is the target user. Some implementations get around this by querying a non-existent user to get an empty response if the requesting user is an admin.
A route to just check if the user's access token givens them admin powers would be great.
maybe /whois/ could simply be extended with an is_admin flag, would be useful for other admin tools surely?
An admin user is a very Synapse orientated concept and putting it in whois would mean adding the concept to the spec for all, I think this would be better housed under the Synapse specific admin namespace
Whois has a Synapse specific endpoint:
GET /_synapse/admin/v1/whois/<user_id>
which is what js-sdk uses
(also the spec is fine with adding more fields to responses, just have to be wary of those fields changing value in the spec)
Whois has a Synapse specific endpoint:
GET /_synapse/admin/v1/whois/<user_id>
which is what js-sdk uses
Though currently it requires that the caller is an admin, @turt2live I think you are asking for a non-admin endpoint?
I read through the code and it requires you to be an admin or be requesting the whois on yourself, which is the case is_admin is desired for
I am asking for a way to determine if the access token gives the user Synapse admin rights. Synapse has an if statement where if you /whois yourself, you can get your data (good), but that means we can't use that to determine admin state.
could you clarify the usecase here? Why do clients want to know if you are an admin?
So they can show a "Deactivate this user" button.
ok.
I'm not quite clear why #6180 was rejected and have reopened it. That said, I'm not sure it's a great solution to the problem.
I'm new to the matrix spec and synapse as a whole, so I just did what was requested in my pull request.
Feel free to suggest better approaches and I'll see what I can do.
This was added in https://github.com/matrix-org/synapse/pull/5914
Most helpful comment
maybe /whois/ could simply be extended with an
is_adminflag, would be useful for other admin tools surely?