public
Created

  • Download Gist
has_permission.js
JavaScript
1 2 3 4 5 6
var hasPermission = function(uid, cb) {
// are we allowed to publish to the user's wall?
var perm = "publish_stream";
var query = FB.Data.query('select ' + perm + ' from permissions where uid={0}', uid);
query.wait(function(rows) { cb(rows[0][perm]); }); // returns 1 or 0
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.