[NEW] Do not rate limit bots on createDirectMessage#7326
Conversation
2532f57 to
af31639
Compare
geekgonecrazy
left a comment
There was a problem hiding this comment.
First off thanks for contributing! Second, i'd like to suggest doing based on permission instead of on role.
There was a problem hiding this comment.
Please use RocketChat.authz.hasPermission(userId, permissionNode) instead of finding a user by id and checking the role.
af31639 to
6f64e37
Compare
|
Follow up question: does the |
|
Was a migration created to apply this to existing bots? If not, then it's kind of pointless to use that permission for previous systems and will only apply to new bots. |
|
@graywolf336 No, I didn't add a migration, didn't think of it. I can add this in a follow-up PR, if you like? |
|
@jangmarker That would be great. Mark it as a |
|
I might be mistaken here, but I understand the permission+roles system to work as follows:
So as long as all bots have the Is that correct? |
|
@jangmarker looks like you're correct. If you modify a permission a migration is needed but looks like if a new one is created no migration is needed: https://github.com/RocketChat/Rocket.Chat/blob/develop/packages/rocketchat-authorization/server/startup.js#L69 |
|
Thanks for confirming :-). Then I think nothing is left for this PR except waiting for it be merged. Thanks for all your help and patience. |
@RocketChat/core
Closes #7302
The code is adapted from similar code in sendMessage.js, including the fix of #7325.