You are here

function fb_permission_fb_required_perms_alter in Drupal for Facebook 6.3

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

Implements hook_fb_required_perms_alter().

fb_connect.module can calls this to learn when perms to add to login-button.

File

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

Code

function fb_permission_fb_required_perms_alter(&$perms) {
  global $_fb, $_fb_app;
  $fb_app_data = fb_get_app_data($_fb_app);
  if (isset($fb_app_data['fb_permission'])) {
    $fb_permission_data = $fb_app_data['fb_permission'];
    foreach ($fb_permission_data['prompt'] as $key => $value) {
      if ($value) {
        $perms[$key] = $key;
      }
    }
  }
}