- Code: Select all
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ($record && $user->val('ID') == $record->val('ID')) {
return Dataface_PermissionsTool::getRolePermissions('MYPROFILE');
} else {
$role = $user->val('Role');
return Dataface_PermissionsTool::getRolePermissions($role);
}
}
That part works, and it works on related records as well.
I now need to show a field in the profile, but disable editing. I'm able to set permissions for ADMIN only:
- Code: Select all
function My_Date__permissions(&$record){
return $this->adminonly();
}
Their permissions are rendered properly - the field does not appear, and only shows up for 'ADMIN' accounts.
When I try setting this to READ_ONLY on a specific field (so users can see the field, but not edit):
- Code: Select all
function My_Status__permissions(&$record){
return Dataface_PermissionsTool::READ_ONLY();
}
When the record is edited... Status is editable.
I'm trying to figure out where I'm doing wrong.
Thanks!