No need to retrieve api key externally, QueryTablesApi takes care

This commit is contained in:
Raul Ochoa 2015-02-09 19:41:38 +01:00
parent 742a9744ea
commit 75c4153f9b

View File

@ -197,31 +197,8 @@ module.exports = function(redisPool) {
} }
return [req.params.table]; return [req.params.table];
} }
var user, key;
var next = this; queryTablesApi.getAffectedTablesInQuery(that.userByReq(req), sql, this); // in addCacheChannel
Step (
function findUserKey() {
if ( req.params.hasOwnProperty('_authorizedBySigner') ) {
user = req.params._authorizedBySigner;
cartoData.getUserMapKey(user, this);
} else {
user = that.userByReq(req);
key = req.params.map_key || req.params.api_key;
return null;
}
},
function getAffected(err, data) {
if ( err ) throw err;
if ( data ) {
if ( req.profiler ) req.profiler.done('getSignerMapKey');
key = data;
}
queryTablesApi.getAffectedTablesInQuery(user, sql, this); // in addCacheChannel
},
function finish(err, data) {
next(err,data);
}
);
}, },
function buildCacheChannel(err, tableNames) { function buildCacheChannel(err, tableNames) {
if ( err ) throw err; if ( err ) throw err;