Restrict Access to some fields in Detail View
Posted: 2020-06-22 14:23
Hello Board, I am trying to restrict access to allow only two groups to approve a record. I have checked the var dump and everything is coming through ok but the access is restricted for everyone and the two groups I want to allow also.
Can you help point me in the right direction?
Can you help point me in the right direction?
Code: Select all
/* work out the group the person is in first and then restrict access to the approvals button for users */
$Group=sqlValue("Select table1.ID From membership_users Inner Join table2 On membership_users.memberID = table2.ID Inner Join table1 On table2.ID2 = table1.ID3 where membership_users.memberID='".$memberInfo['username']."'");
//var_dump($Group, $memberInfo); exit();
/* current user is not the allowed */
if($memberInfo['group'] != $Group || $memberInfo['group'] !='FullAccess'){
$html .= <<<EOC
<script>
\$j(function(){
\$j('#Approval').select2('readonly', true),
\$j('#Notes').attr('readonly', true);
})
</script>
EOC;
}