var gwActionName = 'gwActionName'; var gwClassName = 'gwClassName'; var itemId = '123'; var callback = function( parmas //Object ){ var hasAction = parmas.hasAction; var gwAction = parmas.gwAction; var hasPermission = parmas.hasPermission; var item = parmas.item; if(hasAction && gwAction && hasPermission){ //TODO } }; checkGwActionPermissions(gwActionName, gwClassName, itemId, callback);