Skip to content

feat: Block all email sending actions when an administrator has disabled the permission#2896

Merged
FabianDevel merged 40 commits into
mainfrom
administrator-blocks-email-sending-ui
May 27, 2026
Merged

feat: Block all email sending actions when an administrator has disabled the permission#2896
FabianDevel merged 40 commits into
mainfrom
administrator-blocks-email-sending-ui

Conversation

@Elouan1411

@Elouan1411 Elouan1411 commented May 5, 2026

Copy link
Copy Markdown
Contributor

V0 #2890
Here V1

Copilot AI review requested due to automatic review settings May 5, 2026 15:53
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch from 530e560 to 22dee0c Compare May 5, 2026 15:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds initial support for the new mailbox-level can_send_emails permission so the app can block compose/reply entry points when an administrator disables sending. It spans persisted mailbox permissions, notification actions, and multiple send-related UI surfaces across the main thread and compose flows.

Changes:

  • Add and persist MailboxPermissions.canSendEmails, including a mailbox-info schema bump.
  • Disable or restyle send/reply affordances in thread views, action sheets, the compose entry point, and mailbox selection.
  • Remove notification reply actions and redirect blocked compose launches back to MainActivity with a snackbar.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
app/src/main/res/layout/view_main_actions.xml Updates main action buttons/text to use disabled-aware color selectors.
app/src/main/res/layout/item_bottom_sheet_action.xml Updates bottom-sheet action icon/text colors for disabled states.
app/src/main/res/color/information_block_background_disabled.xml Adds a disabled-aware background tint selector.
app/src/main/java/com/infomaniak/mail/views/BottomQuickActionBarView.kt Adds lookup-based disabling for quick-action menu items.
app/src/main/java/com/infomaniak/mail/utils/NotificationUtils.kt Conditionally removes the notification Reply action based on mailbox permissions.
app/src/main/java/com/infomaniak/mail/utils/extensions/ViewExt.kt Adds shared helpers to bind blocked-sending click behavior and disabled styling.
app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/SelectMailboxViewModel.kt Propagates canSendEmails into mailbox-selection UI models.
app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/SelectMailboxScreen.kt Disables the Continue button when the selected mailbox cannot send.
app/src/main/java/com/infomaniak/mail/ui/newMessage/selectMailbox/compose/AccountMailboxesDropdown.kt Disables blocked mailboxes in the Compose mailbox dropdown.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Adds a helper to decide whether composing is allowed.
app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageActivity.kt Changes compose start-destination logic and redirects blocked launches to MainActivity.
app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Exposes current-mailbox send permission as LiveData and a convenience property.
app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Blocks compose navigation when sending is disabled and shows the admin-disabled snackbar.
app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt Hooks mailbox permissions into thread UI and quick actions.
app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadAdapter.kt Tracks send permission in the adapter and disables per-message reply UI.
app/src/main/java/com/infomaniak/mail/ui/main/thread/DetailedContactBottomSheetDialog.kt Disables the “write mail” contact action when sending is blocked.
app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/MainActionsView.kt Adds menu-id based disabling for the main thread action strip.
app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/MailActionsBottomSheetDialog.kt Disables reply/forward/reaction actions in the mail actions bottom sheet.
app/src/main/java/com/infomaniak/mail/ui/main/thread/actions/ActionItemView.kt Propagates enabled/disabled state to inner views for proper styling.
app/src/main/java/com/infomaniak/mail/ui/main/folder/ThreadListFragment.kt Binds the new-message FAB to mailbox send permissions.
app/src/main/java/com/infomaniak/mail/data/models/mailbox/MailboxPermissions.kt Adds the serialized can_send_emails permission field.
app/src/main/java/com/infomaniak/mail/data/cache/RealmDatabase.kt Bumps mailbox-info schema version for the new permission field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/data/cache/RealmDatabase.kt
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadAdapter.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/utils/extensions/ViewExt.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/newMessage/NewMessageViewModel.kt Outdated
@Elouan1411 Elouan1411 closed this May 5, 2026
@Elouan1411 Elouan1411 reopened this May 6, 2026
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch 2 times, most recently from 1b06e21 to 24cc00c Compare May 6, 2026 09:36
@Elouan1411 Elouan1411 requested a review from Copilot May 6, 2026 11:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 14 comments.

Comment thread app/src/main/res/layout/view_main_actions.xml Outdated
Comment thread app/src/main/res/layout/item_bottom_sheet_action.xml
Comment thread app/src/main/java/com/infomaniak/mail/utils/extensions/ViewExt.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/main/thread/ThreadFragment.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch 5 times, most recently from b7052e1 to 17b152f Compare May 6, 2026 12:03
@Elouan1411 Elouan1411 marked this pull request as draft May 6, 2026 14:04
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch 2 times, most recently from 2af4a3e to 62cd960 Compare May 7, 2026 07:57
@Elouan1411 Elouan1411 requested a review from Copilot May 7, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Comment thread app/src/main/java/com/infomaniak/mail/ui/MainActivity.kt Outdated
Comment thread app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Outdated
@Elouan1411 Elouan1411 marked this pull request as ready for review May 7, 2026 09:05
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch from 2d5a375 to 3b77c14 Compare May 7, 2026 09:06
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch 6 times, most recently from 3a9d2ac to 7dfb8e5 Compare May 22, 2026 12:09
@Elouan1411 Elouan1411 force-pushed the administrator-blocks-email-sending-ui branch from 98bc3e7 to 80fc3bb Compare May 27, 2026 13:25
@sonarqubecloud

Copy link
Copy Markdown

@FabianDevel FabianDevel merged commit 1ff7477 into main May 27, 2026
7 checks passed
@FabianDevel FabianDevel deleted the administrator-blocks-email-sending-ui branch May 27, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants