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).