[NEW] REST API endpoints permissions.list and permissions.update. Deprecated endpoint permissions#10975
Conversation
|
@vynmera you don't have to keep merging develop into your branch, once we get ready to merge then we'll do it. :) As far as deprecation notice, we have a helper method for that on the rest api: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-api/server/helpers/deprecationWarning.js |
|
@graywolf336 Aight :) If you need I can remake the branch. I tried to use the deprecation notice, but there's a problem with the implementation of |
|
@vynmera ahhhhhh okay, that makes sense. Then just duplicate that method's logging notice and update the docs. As far as the branch, you can keep this one. :) Since we'll squash merge this pull request so there is only one commit for it. |
|
@graywolf336 Done! The docs update should already be in this PR: https://github.com/RocketChat/docs/pull/777 |
permissions.list and permissions.update. Deprecated endpoint permissions
Closes #7961
This PR deprecates
/api/v1/permissionsin favor of a new/api/v1/permissions.listand adds/api/v1/permissions.update.permissions.list
Practically the same as the old
permissions, but the permissions are now in apermissionsfield and asuccessfield is included.Example response:
permissions.update
Takes a single field
permissionscontaining an array of objects, which contain the field_idandroles. These new permissions are then merged onto the previous.Example request:
In this example, the
access-permissionspermission is changed to be granted to admins, and theclean-channel-historypermission is changed to be granted to admins and channel owners.The returned value is the same as that of
permissions.list.permissions deprecation
Since
permissionsdirectly returns an array, I have no clue how to implement a deprecation message properly. I've left it out for now, please do tell me if there is any way I could've handled it better.Furthermore, the deprecation warnings I did add are targeted for 0.69.0, assuming my PR will be included in 0.66.0. If this is not the case, please change it or request me to change it.