how to check special permissions in facebook

Yan picture Yan · Oct 14, 2009 · Viewed 8.6k times · Source

how can i check in javascript if user has granted my site the publish stream permission

?

Answer

Andrew Dyster picture Andrew Dyster · Apr 25, 2012

I had this same problem but couldn't find any sample code. Anyways, I came up with this, which works for me. Hope this helps someone.

FB.api('/me/permissions', function (response) {
            var perms = response.data[0];

            if (perms.publish_stream) {                
                // User has permission
            } else {                
                // User DOESN'T have permission
            }                                            
    } );