Posted: Sun Sep 30, 2007 7:44 am
I am getting a "With Selected" "Copy" "Update" on each record when users are not logged in. I don't want users who are not logged in to have these tabs available. Best example is the Librarian demo when you are logged into the backend. I want to have the same results as this demo when you are not logged in. I have been able to eliminate this in my ApplicationDelegate.php but then don't get the other functionality I am looking for on the backend. Either the below is not correct or there is something else driving the result list.
getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::ADMIN();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('role');
if ( isAdmin($role) ) return Dataface_PermissionsTool::NO_ACCESS();
return Dataface_PermissionsTool::NO_ACCESS();
// Returns all of the permissions for the user's current role.
}
function getPreferences(){
$app =& Dataface_Application::getInstance();
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user && isAdmin($user->val('role')) ){
return array();
} else {
return array(
'show_result_stats'=>0,
'show_jump_menu'=>0,
'show_result_controller'=>0,
'show_table_tabs'=>0,
'show_actions_menu'=>0,
'show_tables_menu'=>0,
'show_search'=>0,
'show_record_actions'=>0,
'show_recent_records_menu'=>0,
'show_record_tabs'=>0,
'show_record_tree'=>0,
'show_bread_crumbs'=>0);
}
}
}
?>
Any assistance would be appreciated.
Steve
getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::ADMIN();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('role');
if ( isAdmin($role) ) return Dataface_PermissionsTool::NO_ACCESS();
return Dataface_PermissionsTool::NO_ACCESS();
// Returns all of the permissions for the user's current role.
}
function getPreferences(){
$app =& Dataface_Application::getInstance();
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user && isAdmin($user->val('role')) ){
return array();
} else {
return array(
'show_result_stats'=>0,
'show_jump_menu'=>0,
'show_result_controller'=>0,
'show_table_tabs'=>0,
'show_actions_menu'=>0,
'show_tables_menu'=>0,
'show_search'=>0,
'show_record_actions'=>0,
'show_recent_records_menu'=>0,
'show_record_tabs'=>0,
'show_record_tree'=>0,
'show_bread_crumbs'=>0);
}
}
}
?>
Any assistance would be appreciated.
Steve