I am trying to use hooks to limit the records that a user group sees by setting a filter on the table using this:
table: nbsrt_members
filter on: branch column (#17 in table)
branch values: region1/region2 or region3
I have 3 groups: region1_group / region2_group / region3_group
** I cannot select records based on their entries because these particular users cannot enter records
---------------------------------code I am trying to use to filter for region1_group--------------------------------
function nbsrt_members_init(&$options, $memberInfo, &$args){
/* Apply a default filter only if no filter is already applied by the user */
if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1]){
if($memberInfo['group']=='region1_group') {
if(!$_POST['FilterField'][1] && !$_GET['FilterField'][1])
addFilter(1, 'and' , 17, 'like', 'region1');
}
}
return TRUE;
}
Result is that no filter gets activated and all of the records show for each group - doing something wrong??
Once I get one group working I will add the necessary else statements to handle the other groups.
Filter records by user group
-
- Veteran Member
- Posts: 45
- Joined: 2015-04-15 06:33
- Location: Hyderabad
- Contact:
Re: Filter records by user group
Hi Terry,
pease check your PM i can help you.
pease check your PM i can help you.