Page 1 of 1

is there a way to set permissions to save csv?

Posted: 2018-05-15 17:15
by D Oliveira
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?

Posted: 2018-05-15 17:47
by pbottcher
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.

Re: is there a way to set permissions to save csv?

Posted: 2018-05-15 23:33
by D Oliveira
could u share a sample code?

Re: is there a way to set permissions to save csv?

Posted: 2018-05-16 07:09
by pbottcher
Hi, you can try this, but you need to put it in the hooks/footer-extras.php

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
	}

?>
with $mi['group'] you can restrict the group(s), and with $mi['username'] you can restrict single user(s).

Re: is there a way to set permissions to save csv?

Posted: 2018-05-16 14:15
by D Oliveira
thank you!