$permissions = $facebook->api("/me/permissions");
然后使用if检查您需要哪个权限
EX:
if (array_key_exists('publish_stream',$permissions['data'][0])) { postToWall(); } else { //Does not have permission }
如果您使用的是FQL
$perms = $facebook->api(array( "method" => "fql.query","query" => "SELECT read_stream,offline_access,publish_stream FROM permissions WHERE uid=me()" )); echo "<ul>"; foreach ($perms[0] as $k => $v) { echo "<li>"; if ($v === "1") { echo "<strong>$k</strong> permission is granted."; } else { echo "<strong>$k</strong> permission is not granted."; } echo "</li>"; }
http://www.masteringapi.com/tutorials/how-to-check-if-user-has-certian-permission-facebook-api/22/