chatwoot/app/policies
Sojan Jose 1afcd36dee
fix(contacts): align contact export permissions (#14601)
Allows contact managers to export and import contacts from the Contacts
page while keeping plain agents blocked. The contacts action menu now
mirrors backend permissions for both export and import.

## Closes

- https://linear.app/chatwoot/issue/CW-4438/contact-export-is-broken

## What changed

- Allows Enterprise custom roles with `contact_manage` to pass
`ContactPolicy#export?` and `ContactPolicy#import?`.
- Shows Export and Import to admins and contact managers only.
- Adds Enterprise policy coverage for contact export and import.

## Screenshots

Admin: Export and Import are available.

<img width="3840" height="2160" alt="Admin contact actions with Export
and Import visible"
src="https://github.com/user-attachments/assets/2b2cdaf2-ca8f-470d-be34-31cba68b9dce"
/>

Contact manager: Export and Import are available.

<img width="3840" height="2160" alt="Contact manager contact actions
with Export and Import visible"
src="https://github.com/user-attachments/assets/48fc038b-2e78-4d0c-ba17-a5965641bd88"
/>

Regular agent: Export and Import are hidden.

<img width="3840" height="2160" alt="Regular agent contact actions with
Export and Import hidden"
src="https://github.com/user-attachments/assets/a63b5731-743a-4223-8dab-ce58383067fe"
/>

## How to test

- Sign in as an administrator and open Contacts; the action menu shows
Export and Import.
- Sign in as a custom-role user with `contact_manage`; the action menu
shows Export and Import.
- Sign in as a plain agent; Export and Import are not available and both
APIs remain unauthorized.
2026-06-01 13:58:57 +05:30
..
captain feat: new Captain Editor (#13235) 2026-01-21 13:39:07 +05:30
account_policy.rb feat: Add AI credit topup flow for Stripe (#12988) 2025-12-02 17:53:44 -08:00
agent_bot_policy.rb feat: sign webhooks for API channel and agentbots (#13892) 2026-04-06 15:28:25 +05:30
application_policy.rb chore: Update dependencies (#1173) 2020-09-08 11:24:08 +05:30
article_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
assignment_policy_policy.rb feat: Add assignment policies controllers with jbuilder views (#12199) 2025-08-18 19:15:21 -07:00
automation_rule_policy.rb feat: common attachment endpoint follow-up changes (#7826) 2023-09-01 15:18:48 +07:00
campaign_policy.rb feat: Add APIs for Campaigns (#2175) 2021-04-29 22:23:32 +05:30
category_policy.rb feat(help-center): enable drag-and-drop category reordering (#13706) 2026-03-05 12:53:38 +05:30
contact_policy.rb fix(contacts): align contact export permissions (#14601) 2026-06-01 13:58:57 +05:30
conversation_policy.rb chore: Enforce custom role permissions on conversation access (#12583) 2025-10-22 20:23:37 -07:00
csat_survey_response_policy.rb fix: Allow users with report_manage permission to access CSAT reports (#11625) 2025-05-29 12:09:03 -06:00
custom_attribute_definition_policy.rb fix(security): Enforce admin authorization on custom attribute definitions API (#14392) 2026-05-08 11:42:23 +04:00
custom_filter_policy.rb fix: set custom filter count in redis (#7164) 2023-06-19 16:10:03 +05:30
hook_policy.rb feat: Ability to improve drafts in the editor using GPT integration (#6957) 2023-04-24 23:52:23 +05:30
inbox_policy.rb feat(voice): WhatsApp Cloud Calling — UI [6] (#14346) 2026-05-22 18:42:39 +05:30
label_policy.rb Feature: Improve label experience (#975) 2020-06-25 21:04:03 +05:30
macro_policy.rb fix(macros): disable public visibility for agents (#14349) 2026-05-06 15:10:11 +05:30
portal_policy.rb feat(cloud): Add support for viewing status of SSL in custom domains (#12011) 2025-07-30 10:52:47 -07:00
report_policy.rb chore: Clean up report & knowledge base policies (#11234) 2025-04-03 16:00:32 -07:00
team_member_policy.rb chore: Update method for team members (#1734) 2021-02-09 19:21:31 +05:30
team_policy.rb feat: Team APIs (#1654) 2021-01-17 23:56:56 +05:30
user_policy.rb feat: allow bulk invite create via email (#8853) 2024-02-06 09:04:04 +05:30
webhook_policy.rb Feature: Ability to switch between multiple accounts (#881) 2020-05-26 22:38:48 +05:30