List view lacks columns after access control
Posted: Fri Apr 16, 2010 11:38 pm
Hi, All!
I'm trying to control access to records in a table (called 'tablename' here just as a placeholder) based on the logged-in userid, where each record has a Teacher_ID (users enter this Teacher_ID as their UserName to log in).
I've set up general permissions.ini so logging in works well with the roles defined in my app's User table. Following the docs, I've created my tablename.php Delegate Class in /tables/tablename/.
My DelegateClass.php looks like this :
This properly presents the XF login screen, accepts the username/password from the Users table and logs in the user, and then tries to present the initial list view of the table.
But the list view lacks nearly all its columns!
Except for the Ajax pop-up "+" on the left, none of the data columns are visible: no header row, no corresponding data in the columns.
The records selected for the list view are properly selected, and I can see this by clicking on the individual pop-up + signs, which are listed in their column, row by row.
I'm well confounded and figure I must be missing something obvious--any help would be most greatly appreciated!
Thanks for your time.
I'm trying to control access to records in a table (called 'tablename' here just as a placeholder) based on the logged-in userid, where each record has a Teacher_ID (users enter this Teacher_ID as their UserName to log in).
I've set up general permissions.ini so logging in works well with the roles defined in my app's User table. Following the docs, I've created my tablename.php Delegate Class in /tables/tablename/.
My DelegateClass.php looks like this :
- Code: Select all
<?
class tables_tablename {
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $record and $user and $record->val('Teacher_ID') == $user->val('UserName') ){
return Dataface_PermissionsTool::ALL();
}
return Dataface_PermissionsTool::NO_ACCESS();
}
}
?>
This properly presents the XF login screen, accepts the username/password from the Users table and logs in the user, and then tries to present the initial list view of the table.
But the list view lacks nearly all its columns!
Except for the Ajax pop-up "+" on the left, none of the data columns are visible: no header row, no corresponding data in the columns.
The records selected for the list view are properly selected, and I can see this by clicking on the individual pop-up + signs, which are listed in their column, row by row.
I'm well confounded and figure I must be missing something obvious--any help would be most greatly appreciated!
Thanks for your time.