hi steve
here is what i tried in my ApplicationDelegate.php:
- Code: Select all
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !$user ) return Dataface_PermissionsTool::NO_ACCESS();
//////////////////////////////////////////////
// this works of course
// $owner = "dave";
// if ( $user->val('UserName') == $owner ){
//////////////////////////////////////////////
if ( !isset($record) ) {
if ( $user->val('UserName') == $record->val('owner') ){
return Dataface_PermissionsTool::ALL();
}
return Dataface_PermissionsTool::ALL();
}
}
at least I now get a nicely formattet Error message eg:
Errors
* Permission to perform action 'list' denied.
Requires permission 'view' but only granted ''
and on top of the site I find these lines:
-------------error msg.-------------------------------
On line 324 of file E:\schlumpp\htdocs\df6.11\Dataface\PermissionsTool.php in function printStackTrace()
On line 341 of file E:\schlumpp\htdocs\df6.11\Dataface\PermissionsTool.php in function namesAsArray()
On line 790 of file E:\schlumpp\htdocs\df6.11\Dataface\Application.php in function namesAsString()
On line 1152 of file E:\schlumpp\htdocs\df6.11\Dataface\Application.php in function handleRequest()
On line 19 of file E:\schlumpp\htdocs\df6.11\cdb\index.php in function display()
Warning: Invalid argument supplied for foreach() in E:\schlumpp\htdocs\df6.11\Dataface\PermissionsTool.php on line 326
Warning: implode() [function.implode]: Bad arguments. in E:\schlumpp\htdocs\df6.11\Dataface\Application.php on line 792
--------------end error msg.----------------------------
i only have 2 tables : 1. questions and 2. users
the users table is simply the users table from your FacultyOfWidgetry example
and the questions table has a field named "owner" .
the table questions only contains two records and the field "owner", in both cases is not empty.
thx in advance
martin