Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var grant = function(args){
var deferred = Q.defer();
args['callback'] = function(res){ deferred.resolve(res); }
args['error'] = function(res){ deferred.reject(res); }
pubnub.grant(args);
return deferred.promise;
}