is there a way to set permissions to save csv?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
User avatar
D Oliveira
Veteran Member
Posts: 33
Joined: 2018-03-04 09:30

is there a way to set permissions to save csv?

Post by D Oliveira » 2018-05-15 17:15

Hello, do any of you know if theres a quick way to set permissions on who can use the 'save csv' feature?

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 84
Joined: 2018-04-01 10:12

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

Post by pböttcher » 2018-05-15 17:47

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.

User avatar
D Oliveira
Veteran Member
Posts: 33
Joined: 2018-03-04 09:30

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

Post by D Oliveira » 2018-05-15 23:33

could u share a sample code?

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 84
Joined: 2018-04-01 10:12

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

Post by pböttcher » 2018-05-16 07:09

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).

User avatar
D Oliveira
Veteran Member
Posts: 33
Joined: 2018-03-04 09:30

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

Post by D Oliveira » 2018-05-16 14:15

thank you!

Post Reply