Skip to content

Instantly share code, notes, and snippets.

@ashaw
Created August 30, 2011 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashaw/1181004 to your computer and use it in GitHub Desktop.
Save ashaw/1181004 to your computer and use it in GitHub Desktop.
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
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment