Filter records by user group

Discussions related to customizing hooks. Hooks are documented at
Post Reply
Posts: 4
Joined: 2013-01-08 17:34

Filter records by user group

Post by Terry » 2015-04-30 13:59

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.

Satya Kavala
Veteran Member
Posts: 45
Joined: 2015-04-15 06:33
Location: Hyderabad

Re: Filter records by user group

Post by Satya Kavala » 2015-05-21 05:59

Hi Terry,
pease check your PM i can help you.
Satya Kavala
[email protected]

Post Reply