Page 1 of 1

fieldname permissions

PostPosted: Tue Feb 21, 2012 11:27 pm
by samhans
hai steve and all;

problem with fieldname permissions

function section__permissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
$role = $user->val('Role');
if ($role == "ADMIN") return null;
if ($role == "APPROVER")return Dataface_PermissionsTool::ALL();
if ($role == "DEMANDE")return Dataface_PermissionsTool::READ_ONLY();


}

NOW THE PROBLEM IS THAT THE FIELD SECTION HAS NO CHANGE AND DEMANDE CAN ALSO EDIT THE FIELD.
WHEN I AM CHANGING TO NO_ACCESS() THEN THE FIELD DISAPPEARED FROM THE LIST AND THE FORM PAGE.

I WANT THAT APPROVER CAN EDIT THE FORM BUT DEMANDE CAN ONLY VIEW IT.

PLEASE HELP.
THANKS IN ADVANCE

Re: fieldname permissions

PostPosted: Wed Feb 22, 2012 2:18 am
by Jean
Hi,
Are you sure it is
Code: Select all
$user->val('Role');
and not
Code: Select all
$user->val('role');


Jean

Re: fieldname permissions

PostPosted: Wed Feb 22, 2012 3:07 am
by samhans
hai jean ,
definitely it is Role.

Re: fieldname permissions

PostPosted: Wed Feb 22, 2012 6:23 am
by Jean
Try
Code: Select all
return Dataface_PermissionsTool::getRolePermissions('READ ONLY');