[FIX] /me REST endpoint was missing user roles and preferences#10240
[FIX] /me REST endpoint was missing user roles and preferences#10240
Conversation
Add roles and preferences to /me endpoint and remove users.roles endpoint
|
@rafaelks, could you take a look, please? |
|
Great! Looking good to me (not tested the code running yet). |
|
Thank you @MarcosSpessatto |
There was a problem hiding this comment.
preferencesArentSetupYet would be a better english name for this 👍
| Method: GET | ||
| Route: api/v1/user.roles | ||
| */ | ||
| RocketChat.API.v1.addRoute('user.roles', { authRequired: true }, { |
There was a problem hiding this comment.
Instead of removing this right now, let's deprecate this for three releases and then remove it on the fourth release. Yes I know this endpoint is not working as we would expect, however there might be someone who is using it and as soon as we remove it without warning we will break their system.
So, for deprecation example. If this gets added to v0.64, then it will be removed on v0.67. Because it will be deprecated on v0.64, v0.65, and v0.66, then removed on v0.67.
| Method: GET | ||
| Route: api/v1/user.roles | ||
| */ | ||
| RocketChat.API.v1.addRoute('user.roles', { authRequired: true }, { |
There was a problem hiding this comment.
Please add a console.warn('The endpoint /api/v1/user.roles is deprecated and will be removed after version v0.xx.'). Also, add it to the resulting object but only when we are in a development environment. Which, might need to add a helper method which generates everything I just mentioned with providing the endpoint and the version it will be removed.
We will need to update the deprecation warnings for the real version after it has been merged.
Add deprecation warning to user.roles endpoint
There was a problem hiding this comment.
I apologize for being so picky, but can the endpoint be surrounded in quotes? The endpoint "${ endpoint }" is..
Add user roles and preferences to /me endpoint and removed the endpoint with problems, /users.roles.