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
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

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?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

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

Post by pbottcher » 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.
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.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

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?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

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

Post by pbottcher » 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).
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.

User avatar
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

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

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

thank you!

Post Reply