Save CSV for specific groups only
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Save CSV for specific groups only
Hi All, is there a way to show 'Save CSV' button to the specific groups only? In Appgini it either removes this button completely or show to all. I need this button to only be available for Admin group and maybe one another. I've seen two old posts here that suggests the way of doing, but neither of them seem to work. First suggestion not doing anything, second does the same as Apggini app, show or remove for all. I do appreciate your help! Thanks
Re: Save CSV for specific groups only
Hi,
you can use the hooks/TABLENAME.php file (TABLENAME = your table) and put into the
TABLENAME_init function
the code:
this would only allow the members of the Admins group to use the CSV download
you can use the hooks/TABLENAME.php file (TABLENAME = your table) and put into the
TABLENAME_init function
the code:
Code: Select all
if ($memberInfo['group'] != 'Admins')
{
$options->AllowCSV = 0;
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Save CSV for specific groups only
Thanks Pböttcher, you are Star!! It works Can I ask how do add the second group ? Thank You!
Re: Save CSV for specific groups only
Hi,
you can do e.g.
or
replace Group2, Group3 with your groups,
the etc... is symbolic for additional groups to be added
you can do e.g.
Code: Select all
if (!in_array($memberInfo['group'],array('Admins','Group2','Group3','etc...')
Code: Select all
if ($memberInfo['group'] != 'Admins' && $memberInfo['group'] != 'Group2' && $memberInfo['group'] != 'Group3' etc... )
the etc... is symbolic for additional groups to be added
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
- aarlauskas
- Veteran Member
- Posts: 127
- Joined: 2019-04-28 18:03
- Location: Medway, UK
Re: Save CSV for specific groups only
Thank You!! Have a Great Weekend!