Monday, June 15, 2009

Dataface_Record::display() shows "NO ACCESS"

Perhaps you have run into this issue.  You have set up your Xataface application permissions the way that you want, but you have a custom action that displays a report for which you want to ignore permissions.  The Dataface_Record::display() method respects permissions so that if you try to display a field value that the user doesn't have permission to see, it will simply print as "NO ACCESS". 
If you are creating a custom action you may want to temporarily ignore these permissions since you have such direct control over what the user sees already.  It is easy to fix this by setting the secureDisplay parameter of the Dataface record to false.

E.g.

$record = df_get_record('people', array('personid'=>10));
$record->secureDisplay = false;
echo "First Name: ". $record->display('first_name');
...


No comments:

Post a Comment