# How to restrict users to export contact from mautic

**URL:** <https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845>\
**Category:** Product Support\
**Created:** [February 27, 2022, 8:02pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845 "2022-02-27T20:02:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [February 27, 2022, 8:02pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/1 "2022-02-27T20:02:04Z")

</div>

**Your software**  
My Mautic version is: 4.1.2  
My PHP version is: Php 7.4  
My Database type and version is: mysql Ver 14.14 Distrib 5.7.27-30,

**Your problem**  
My problem is: Not able to restrict users to export contact from mautic.

I have multiple user in mautic account. I have created role, But did not find any permission where I can stop a user to export contact in Excel and csv.  
How can I restrict my user to export contacts ?

These errors are showing in the log: no

Steps I have tried to fix the problem:  
I have tried to create Roles with Multiple options.

![mautic](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/9/9c0e0c9cc3e5cb42075fe9426cad69ad3ece42af.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [February 28, 2022, 12:41pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/2 "2022-02-28T12:41:11Z")

</div>

Hi,. have you tested if restricted users can maybe only export their own contacts?

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [March 2, 2022, 8:41pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/3 "2022-03-02T20:41:16Z")

</div>

Hi @joeyk  
If i have allowed user to view all contact, Then the user can export all contact.

And if user is allowed to view his own contact, in that case user export his own contact only.

But i want user to view his own and others contact both. But don’t allow him to export.  
I did not find this solution.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 3, 2022, 11:41am UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/4 "2022-03-03T11:41:17Z")

</div>

From a program design point of view I don’t see a point in allowing to view but not to export.  
If you can view something you can export as well (worst case by using a little code.)

Joey

---

<div class="post-metadata">

**Author:** ![ricksimnett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricksimnett/32/1578_2.png) [@ricksimnett](https://forum.mautic.org/u/ricksimnett)\
**Post date:** [March 3, 2022, 1:36pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/5 "2022-03-03T13:36:54Z")

</div>

Hi Sonu,

Can you explain your use case to me?

After reading this it occurred to me that it might be useful to be able to restrict the export options - especially if you’re using Mautic as a CRM and have a sales / support team interacting with it.

I wouldn’t want sales team members exporting records of any kind (theirs or not) if they decided to leave the company. Just part of maintaining the funnel of opportunities.

I did try this myself in 4.2 and found the same thing you reported.

Thanks,  
Rick

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 3, 2022, 1:58pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/6 "2022-03-03T13:58:31Z")

</div>

The problem is: if you view the contact, you can export the contact. Maybe not with the export button, but many other ways. (Chrome plugin, etc)  
If you want to restrict, then restrict view as well.

---

<div class="post-metadata">

**Author:** ![ricksimnett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricksimnett/32/1578_2.png) [@ricksimnett](https://forum.mautic.org/u/ricksimnett)\
**Post date:** [March 3, 2022, 2:10pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/7 "2022-03-03T14:10:26Z")

</div>

@joeyk - I understand your point completely. Sure things can be scraped, etc. But that being the case, not all users are equal in knowledge or skill.

I can see how not allowing exports may help to prevent / protect data from taking a walk.

For example, lets consider this case of a sales team.

I hire an employee who works sales for 1 year. They are paid a weekly salary to make contacts, put them into mautic and nurture the relationship into a sale. This is accomplished partially through the sales representative and partially through mautics automation (email, dwc etc).

Because sales is typically a high turnover job, I dont want the person to leave with all of the leads I paid them to cultivate for that year. So I want to prevent them from being able to “easily” export all of the contacts.

Sure they will know some of them right of the top of their head, sure they could scrape them one by one, or write them down one by one and take them to a new sales job for a competitor - but I dont want to make it as easy as Export Contacts so that they can easily just take the book of leads and leave.

Plus some roles (like customer service roles) should be able to only view a contact and not be able to export them. They just touch the data as necessary - they arent responsible for its cultivation or management.

I think there is a good use case for extending the Roles form and permissions system to allow data exports to be restricted.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [March 3, 2022, 2:45pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/8 "2022-03-03T14:45:19Z")

</div>

Hey folks

Please review and test this PR:

> <https://github.com/mautic/mautic/pull/5995>
>
> \*\*Please be sure you are submitting this against the \_staging\_ branch.\*\*
> 
> \[//\]…: # ( Please answer the following questions: )
> 
> | Q | A
> | --- | ---
> | Bug fix? | 
> | New feature? | Yes
> | Automated tests included? |
> | Related user documentation PR URL | 
> | Related developer documentation PR URL | 
> | Issues addressed (#s or URLs) | 
> | BC breaks? | 
> | Deprecations? | 
> 
> \[//\]: # ( Note that all new features should have a related user and/or developer documentation PR in their respective repositories. )
> 
> \[//\]: # ( Required: )
> \#### Description:
> Added new permission for export in form results. This PR not require migrations, exports are default enable. This permission give ability disable export permission for Contacts, Forms, Reports.
> 
> !\[image\](https://user-images.githubusercontent.com/462477/39305083-21ff9dc0-495c-11e8-9e23-1805dd639c8e.png)
> 
> \#### Steps to test this PR:
> 1. Create new user with role and enable all permission for Contacts, Forms, Reports with unchecked new Export access: Disable 
> 2. Login as new user and see If exports buttons exists and exports works properly in all sections: Contacts (batch export), Form (results exports) and Reports
> 3. Open HTML exports of Form results and Reports.
> 4. Edit in incognito user permission and disable export 
> 5. See If export button are hidden in Form results and Reports and Contacts lists in batch.
> 6. See If opened HTML export from 3. return access denied after refresh
> 
> 
> \<a href="https://gitpod.io/#https://github.com/mautic/mautic/pull/5995"\>\<img src="https://gitpod.io/button/open-in-gitpod.svg"/\>\</a\>

It would have been merged sooner but we have not had enough testers. Testing is well documented here:

> **[Tester](https://contribute.mautic.org/contributing-to-mautic/tester)**
>
> . Every new feature and bug fix that is released in Mautic has undergone testing and code review by members of the community before it makes it into a release.We are always looking out for people to help us with these processes. Even if you can spare...

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 3, 2022, 3:24pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/9 "2022-03-03T15:24:17Z")

</div>

Yeah, that PR is great, I hope you can test it out.  
I can see the use case here, just wanted to draw the attention to the limitations.  
Joey

---

<div class="post-metadata">

**Author:** ![ricksimnett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricksimnett/32/1578_2.png) [@ricksimnett](https://forum.mautic.org/u/ricksimnett)\
**Post date:** [March 3, 2022, 3:58pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/10 "2022-03-03T15:58:24Z")

</div>

Ill check it out and test this PR.

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [March 3, 2022, 4:50pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/11 "2022-03-03T16:50:47Z")

</div>

@ricksimnett You are correct. We recently thought and tried to use mautic as CRM.  
and have 16users. Now I have 2 problems

1. If i give the permission to user, to view all his own and other’s contact. Employee can export all contacts easily. That is good, and data can be stolen.
2. and if I give the permission to a user to view his own contact, then while adding a new contact user don’t know which contact is already there in Mautic. because he is not able search in all contacts.  
And it creates a duplicate record. It should be fixed.  
Mautic should show a message that “contact already exist” if primary key “email address” is added by user again.

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [March 3, 2022, 5:11pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/12 "2022-03-03T17:11:59Z")

</div>

@ricksimnett You put it and explained perfectly.  
Leads from Mautic should not be allowed to export so easily for employee.

and coping lead one by one will be hard. And scraping is not easy, require skill.

Mautic can be easy used as CRM for most of the use cases with some field modifications. Because mautic is powerful in sending email and tracking contact footprints.

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [October 22, 2022, 1:19pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/13 "2022-10-22T13:19:41Z")

</div>

Hi ricksimnett

Did you test this PR about restrict users to export contact ?

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [October 22, 2022, 1:20pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/14 "2022-10-22T13:20:27Z")

</div>

Hi @joeyk

Did you test this PR about restrict users to export contact ?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [October 24, 2022, 7:00am UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/15 "2022-10-24T07:00:51Z")

</div>

Hi, no. I stopped testing after the errors were reported.

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [January 4, 2023, 8:17pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/16 "2023-01-04T20:17:38Z")

</div>

anyone working on this ?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 5, 2023, 7:37am UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/17 "2023-01-05T07:37:37Z")

</div>

The progress can see in the github repo.  
A bit help: programmers rarely participate here in forums, it makes sense to post your repo related questions in the Github repo.

---

<div class="post-metadata">

**Author:** ![sonu88](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/sonu88/32/6164_2.png) [@sonu88](https://forum.mautic.org/u/sonu88)\
**Post date:** [January 6, 2023, 5:17pm UTC](https://forum.mautic.org/t/how-to-restrict-users-to-export-contact-from-mautic/22845/18 "2023-01-06T17:17:57Z")

</div>

Yes, I see @joeyk
