You are here

function fb_permission_map in Drupal for Facebook 6.3

Same name and namespace in other branches
  1. 6.2 contrib/fb_permission.module \fb_permission_map()
  2. 7.3 contrib/fb_permission.module \fb_permission_map()

Which permissions can we prompt for?

@TODO - update this list and/or make it customizable.

1 call to fb_permission_map()
fb_permission_user in contrib/fb_permission.module
Implementation of hook_user.

File

contrib/fb_permission.module, line 25
Code pertaining to Facebook's extended permissions. see http://wiki.developers.facebook.com/index.php/Extended_permissions

Code

function fb_permission_map($fb) {
  static $perms;

  // http://developers.facebook.com/docs/reference/fql/permissions_info
  $result = fb_fql_query($fb, "SELECT permission_name, header, summary FROM permissions_info WHERE 1", array(
    'access_token' => fb_get_token($fb),
  ));
  if (!isset($perms)) {
    foreach ($result as $data) {
      $perms[$data['permission_name']] = 'Allow %application to ' . strtolower($data['summary'] ? $data['summary'] : 'access ' . $data['header']);
    }
  }
  return $perms;
}