Q:

Facebook permissions: How to check if the user has already allowed publish_stream for your application

How do I check if the user has already allowed your application to publish on his stream (to avoid the momentarily popup menu). Currently I'm simply using this JavaScript code:
<script>
    <!--
        Facebook.showPermissionDialog('publish_stream,read_stream');
    //-->
</script>

A:

The right way to do this with the Graph API is to use User.permissions.
See: https://developers.facebook.com/tools/explorer/?method=GET&path=me%2Fpermissions
So with the JS SDK you can do:
FB.api('/me/permissions', checkAppUserPermissions);

function checkAppUserPermissions(response) {
    console.log("User permissions response", response);
}

A:

Use Users.hasAppPermission to check if a user has those permissions.
General API: http://wiki.developers.facebook.com/index.php/Users.hasAppPermission
Javascript library: http://developers.facebook.com/docs/?u=facebook.jslib.FB.ApiClient.users_hasAppPermission

