The following example checks that the logged user belongs to the admin group and accordingly allows CSV downloading of records. If the user is not a member of the admin group, CSV downloads are disabled.

On the hooks folder look for the tablename.php

function tablename_init(&$options, $memberInfo, &$args){
 
    if($memberInfo['group']=='Admins'){
        $options->AllowCSV=1;
    }else{
        $options->AllowCSV=0;
    }
     
    return true;
}