is there a way to set permissions to save csv?
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
is there a way to set permissions to save csv?
Hello, do any of you know if theres a quick way to set permissions on who can use the 'save csv' feature?
Re: is there a way to set permissions to save csv?
Hi,
you can use the header-extras hook to check the user/group and remove the "save csv" button if the user group is not permitted.
you can use the header-extras hook to check the user/group and remove the "save csv" button if the user group is not permitted.
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.
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David
Re: is there a way to set permissions to save csv?
could u share a sample code?
Re: is there a way to set permissions to save csv?
Hi, you can try this, but you need to put it in the hooks/footer-extras.php
with $mi['group'] you can restrict the group(s), and with $mi['username'] you can restrict single user(s).
Code: Select all
<?php
$mi = getMemberInfo();
if(in_array($mi['group'], array('Group1', 'Group2')) || in_array($mi['username'], array('User1', 'User2')))
?>
<script type="text/javascript">
$j('#CSV').remove();
</script>
<?php
}
?>
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.
- D Oliveira
- AppGini Super Hero
- Posts: 347
- Joined: 2018-03-04 09:30
- Location: David