You are here

function fb_permission_user_categories in Drupal for Facebook 7.3

Implements hook_user_categories().

File

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

Code

function fb_permission_user_categories() {
  $items = array();

  // A tab for each application
  foreach (fb_get_all_apps() as $fb_app) {

    // TODO: limit only to apps which can be added to a user's account.
    $items[] = array(
      'name' => $fb_app->label,
      'title' => $fb_app->title,
      'access callback' => 'fb_permission_access_own',
      'access arguments' => array(
        1,
        'edit own extended permissions',
      ),
      'weight' => 2,
    );
  }
  return $items;
}