Skip to content

Instantly share code, notes, and snippets.

@kineticac
Created March 20, 2011 03:34
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 kineticac/878046 to your computer and use it in GitHub Desktop.
Save kineticac/878046 to your computer and use it in GitHub Desktop.
Wait on Facebook permissions FQL request
// assuming we already have the query created, wait on it with a callback
query.wait(function(permissions){
// master list for granted permissions
var grantedPermissions = new Array();
// your basicPerms converted into an array "read_stream,user_interests"
var permArray = new Array();
permArray = basicPerms.split(",");
// iterate through your basicPerms and add them
// to the master list if it's granted (==1)
$.each(permArray, function(index, perm){
if(permissions[perm] == "1"){
if($.inArray(perm, grantedPermissions) < 0)
grantedPermissions.push(perm);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment