Drupal Permissions & Facebook

In my code snippets I am reading a set of variables that identify which roles the currently logged in user has.

If I log in locally, those permissions are properly set. If I log in via Facebook (using the drupal for facebook module), the permissions are not set even though the new permissions are properly recorded in the database.

I need a piece of code that will essentially read the permission information off of the disk and place it into memory. I expect it to be a few lines of php code. The hard part will be finding out exactly where the code should go (probably in the facebook connect module).

My snippet looks like this:

<?php if (in_array('team member', $GLOBALS['user']->roles)): ?>

Some html for team members

<?php elseif (in_array('facebook authorized user', $GLOBALS['user']->roles)): ?>

Some html for Facebook Authorized Users

<?php elseif (in_array('anonymous user', $GLOBALS['user']->roles)): ?>

Some html for Anonymous Users

<?php else : ?>

<p>Your roles are: <?php print_r( $GLOBALS['user']->roles); ?></p>

<?php endif; ?>

<?php print "Current Roles: " . join(":", $GLOBALS['user']->roles); ?>

So, basically, we need to read the permissions from the database (which are correct) into the GLOBALS['user']->roles variable.

The primary related modules that have been put in place are Drupal for Facebook (fb) and Node Access (nodeaccess).


Compétences : Drupal, MySQL, PHP

en voir plus : drupal globals user roles, drupal php snippets, facebook drupal permission, primary modules, facebook facebook facebook facebook, facebook. facebook, team member roles, snippet, php drupal, GLOBALS, roles permissions, code disk, module drupal, drupal user module, permissions php, drupal print, team member, drupal user access, read memory, php user permission, connect node, join facebook, php elseif, php node, users currently logged

Concernant l'employeur :
( 9 commentaires ) Roseville, United States

Nº du projet : #1009628

Décerné à:


please check the pm.

%selectedBids___i_sum_sub_7% %project_currencyDetails_sign_sub_8% USD en 0 jours
(13 Commentaires)

2 freelance font une offre moyenne de $40 pour ce travail


hi I can do it for you!

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(11 Commentaires)