Field Permissions Problem
Posted: Thu Oct 22, 2009 3:29 am
Hello,
I have successfully implemented field level permissions using the function below, however when I add the line to set permissions based on another field (status_id) I get a fatal error:
Fatal error: Call to a member function val() on a non-object in...
What am I doing wrong?
I have successfully implemented field level permissions using the function below, however when I add the line to set permissions based on another field (status_id) I get a fatal error:
- Code: Select all
function short_description__permissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
$role = $user->val('user_role');
if ($role == "ADMIN") return null;
if ($role == "MANAGER") return null;
if ($record->val('status_id') == "6") return array('edit'=>0);
$user_type = $user->val('user_type');
if ($user_type == "T") return null;
if ($user_type == "E") return array('edit'=>0);
}
Fatal error: Call to a member function val() on a non-object in...
What am I doing wrong?