-
Notifications
You must be signed in to change notification settings - Fork 10.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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/permissions
in favor of a new/api/v1/permissions.list
and adds/api/v1/permissions.update
.permissions.list
Practically the same as the old
permissions
, but the permissions are now in apermissions
field and asuccess
field is included.Example response:
permissions.update
Takes a single field
permissions
containing an array of objects, which contain the field_id
androles
. These new permissions are then merged onto the previous.Example request:
In this example, the
access-permissions
permission is changed to be granted to admins, and theclean-channel-history
permission is changed to be granted to admins and channel owners.The returned value is the same as that of
permissions.list
.permissions deprecation
Since
permissions
directly 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.