Hi rhc,
I wanted to do exactly the same thing a couple of days ago - the answer is in this thread (you need to use delegate classes for each table):
viewtopic.php?f=4&t=6047My table 'SITE_RECORDS' has a file SITE_RECORDS.php that looks like this:
- Code: Select all
class tables_SITE_RECORDS{
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::READ_ONLY();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('ROLE');
return Dataface_PermissionsTool::getRolePermissions($role);
// Returns all of the permissions for the user's current role.
}
}
?>
Paul
EDIT: Note the comment is wrong (I copied it from the wiki), it gives READ_ONLY access not NO_ACCESS.