Description
Refactor the EmailAccount.deactivated boolean field into more granular control fields to better manage account capabilities.
Current behavior
Currently "deactivated" means:
- Account can still receive email
- Account can be configured via UI and REST API
- Account CANNOT send email
New behavior
- Add
is_send_enabled field: Controls whether account can send email
- Can ONLY be modified from admin interface by admins
- Add
is_receive_enabled field: Controls whether account can receive email
- CAN be modified from EmailAccount UI and REST API by the user
- Redefine
deactivated field: When True, account cannot:
- Send email (regardless of is_send_enabled setting)
- Be modified via UI or REST API (EXCEPT toggling is_receive_enabled)
- Can ONLY be modified from admin interface by admins
- NOTE: User login is controlled by Users, not EmailAccounts - users can still log in
- NOTE: Deactivated accounts CAN still receive email (if is_receive_enabled is True)
Permission summary
- Admin interface: Can modify deactivated, is_send_enabled, is_receive_enabled
- EmailAccount UI/REST API: Can ONLY modify is_receive_enabled (even if account is deactivated)
Tasks
Description
Refactor the EmailAccount.deactivated boolean field into more granular control fields to better manage account capabilities.
Current behavior
Currently "deactivated" means:
New behavior
is_send_enabledfield: Controls whether account can send emailis_receive_enabledfield: Controls whether account can receive emaildeactivatedfield: When True, account cannot:Permission summary
Tasks
deactivatedandis_send_enabledis_receive_enableddeactivatedstate