Hello AppGini users!
I would like to disable CSV data export for certain users/groups.
Preferably, this could be done manually by the Admin.
Is there a simple way that a non-coder like me could do this?
Thank you in advance for any help and/or suggestion!
Disable CSV export?
Re: Disable CSV export?
Hi,
well, I dont think this will work without code.
Also the requirement seems not completely clear. Do you want to disable CSV export for all tables for certain users / groups, or definied per table individually?
well, I dont think this will work without code.
Also the requirement seems not completely clear. Do you want to disable CSV export for all tables for certain users / groups, or definied per table individually?
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.
Re: Disable CSV export?
pböttcher, thank you again for your feedback!
I would like to be able to prevent some employees to export CSV data of EVERY table in the database.
So, some employees will be able to export CSV, some will not have this right.
For better understanding:
Employee Tom will be able to export CSV (of any table he wants).
Employee Mark will not have the right to export CSV at all - regardless of the table.
So basically: CSV EXPORT ON and OFF switch.
This right will be granted by the admin MANUALLY for each employee.
pböttcher, if the code is not too complicated to write - I'm sure I could implement into the project (with some instruction).
If you think that this will be complicated - I could give you my email for PM - so you could give me the estimate for the project.
Thank you in advance!
I would like to be able to prevent some employees to export CSV data of EVERY table in the database.
So, some employees will be able to export CSV, some will not have this right.
For better understanding:
Employee Tom will be able to export CSV (of any table he wants).
Employee Mark will not have the right to export CSV at all - regardless of the table.
So basically: CSV EXPORT ON and OFF switch.
This right will be granted by the admin MANUALLY for each employee.
pböttcher, if the code is not too complicated to write - I'm sure I could implement into the project (with some instruction).
If you think that this will be complicated - I could give you my email for PM - so you could give me the estimate for the project.
Thank you in advance!
Re: Disable CSV export?
Hi,
well as a quick solution, I would create a new table "allow_csv" with two fields:
id <-- PK
name <-- unique varchar(100)
Then you allow only the admin to see this table and handle all entries.
In this table (allow_csv) you can store all names that are allowed the CSV export. Make sure that the name matches the username as stored in the membership_users table. (You may check if the name matches in the before_insert/update function)
Now in the _init function (of each table) you check if the $memberInfo['username'] is contained in the record of the allow_csv table.
If no, set
$options->AllowCSV=0.
That should work.
If you need help, you may contact me by PM
well as a quick solution, I would create a new table "allow_csv" with two fields:
id <-- PK
name <-- unique varchar(100)
Then you allow only the admin to see this table and handle all entries.
In this table (allow_csv) you can store all names that are allowed the CSV export. Make sure that the name matches the username as stored in the membership_users table. (You may check if the name matches in the before_insert/update function)
Now in the _init function (of each table) you check if the $memberInfo['username'] is contained in the record of the allow_csv table.
If no, set
$options->AllowCSV=0.
That should work.
If you need help, you may contact me by PM
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.
Re: Disable CSV export?
Thank you very much, pböttcher!
I'll contact you soon when I catch some time to do it!
Cheers!
I'll contact you soon when I catch some time to do it!
Cheers!
Re: Disable CSV export?
Ahmed pinpointed me to the solution:
https://bigprof.com/appgini/help/advanc ... ename_init
Again, thank you for your suggestion!
https://bigprof.com/appgini/help/advanc ... ename_init
Again, thank you for your suggestion!
Re: Disable CSV export?
in my project i remove CSV button
i add this code on footer-extras.php
i add this code on footer-extras.php
Code: Select all
<?php }
$mi = getMemberInfo();
if(!in_array($mi['group'], array('Admins', 'Data entry'))){
?>
<script>
$j("#CSV").remove();
$j('.btn-import-csv').hide();
</script>
<?php
}
?>