Checking Extended Permissions

Problem

How can I check to see whether a user has granted my app extended permissions?

Solution

Use the Users.hasAppPermission() method, which is not currently included in the PHP Client Library (see Adding Missing PHP Client Library Methods):

$permission = $facebook->api_client->Users_hasAppPermission('status_update');

Discussion

This will return true (1) or false (0). There are three extended permissions you can check for:

status_update

You can set the user’s status with Users.setStatus().

create_listing

You can create Marketplace listings for the user.

photo_upload

You can upload photos and set tags on nonpending photos.

See Extended Permissions for more information.

Get Facebook Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.