Skip to content

Commit

Permalink
Bugfix on aggregation worker when updating a user
Browse files Browse the repository at this point in the history
  • Loading branch information
Razvan Botea committed Sep 14, 2016
1 parent b35f11e commit 0c1d7cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/aggregation_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ AggregationWorker.prototype.processMessage = function(message) {
},
function getAffectedChannels(callback) {
async.each(deltasToWrite, function(d, c) {
self.getAffectedChannels(d.object, d.application_id, function(err, channels) {
self.getAffectedChannels(d.object, d.application_id || message.application_id, function(err, channels) {
if (err)
return c(new Error('Failed to get affected channels: '+err.message));
d.subscriptions = channels.map(function(channel) {
Expand Down Expand Up @@ -258,6 +258,9 @@ AggregationWorker.prototype.getAffectedChannels = function(item, appId, callback
AggregationWorker.prototype.validateAuthor = function(object, aclType, userId, callback) {
var appSchema = Models.Application.loadedAppModels[object.application_id].schema;

if (!appSchema[object.type])
return callback();

if ((appSchema[object.type][aclType] & 8) && userId) {
var authorFields = (appSchema[object.type].author_fields || []).concat('user_id');

Expand Down

0 comments on commit 0c1d7cb

Please sign in to comment.