-
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
Regression: New Livechat methods and processes #15242
Conversation
…s not reactivity for Livechat Managers in some Livechat Templates. such as visitorInfo, visitorEdit and so on.
@@ -9,7 +9,7 @@ Meteor.publish('livechat:rooms', function(filter = {}, offset = 0, limit = 20) { | |||
return this.error(new Meteor.Error('error-not-authorized', 'Not authorized', { publish: 'livechat:rooms' })); | |||
} | |||
|
|||
if (!hasPermission(this.userId, 'view-livechat-rooms')) { | |||
if (!hasPermission(this.userId, 'view-livechat-rooms') && !(filter._id && hasPermission(this.userId, 'view-l-room'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is always harder to read conditions like this, where you test the truth value but negates afterwards.
is this the same?
if (!hasPermission(this.userId, 'view-livechat-rooms') && !(filter._id && hasPermission(this.userId, 'view-l-room'))) { | |
if (!hasPermission(this.userId, 'view-livechat-rooms') && !(filter._id && hasPermission(this.userId, 'view-l-room'))) { | |
if (!hasPermission(this.userId, 'view-livechat-rooms') || (filter._id && !hasPermission(this.userId, 'view-l-room'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also is this the case where an agent is trying to view a room's data? in this case should we only allow it to view the data if he is the servedBy
agent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is exactly that case.
I improved the code, so now it will check the right validation/permission just like your last question.
Thanks.
Hi @sampaiodiego! Thanks. |
@sampaiodiego
The documentation will be updated later. |
After reviewed the codebase where there are a lot of new implementations related to Livechat pull requests, I noticed that some methods needed improvements and fixes to work as well as expected.
Important change:
We're renaming the Livechat Routing methods, as described below:
Guest Pool
toManual Selection
;Least Amount
toAuto Selection
;In addition: The Room model(client side) has been replaced with LivechatRoom model in some Livechat templates, such as
visitorInfo
andvisitorEdit
. This change was necessary because the reactivity was not working for Livechat Managers because the models based onCachedCollection
only emit changes to the users who have the related subscription and the Livechat Managers have permission to access those templates even they don't have that subscription.This is a PR that needs to be merged before the next release ->
2.0.0
.