fix(people): default portal email checkbox to checked, respect user choice#2806
Merged
fix(people): default portal email checkbox to checked, respect user choice#2806
Conversation
…r choice Remove auto-send override based on published policies so the checkbox reflects actual behavior. Guard resend endpoint to employee/contractor only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
cubic analysis
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Linked issue analysis
Linked issue: CS-72: [Improvement] - Option to trigger employee portal email for employees added after policies have been published
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Provide an option to send the onboarding/employee portal email when new employees are added if policies have been published | UI + backend now honor invite.sendPortalEmail flag |
| ✅ | Unchecking the option should prevent the portal email from being sent (respect user choice) | Backend uses invite.sendPortalEmail only to decide send |
| ✅ | Default to sending the portal email when adding new employees (checkbox default checked) | Invite modal default set to true |
| ❌ | Automatically send this email upon user creation when there are existing published policies | Removed hasPublishedPolicies auto-send logic |
| New employees added after policies published receive portal email prompting review/sign | Default + backend flag present, explicit send call not shown in diffs |
Check BUILT_IN_ROLE_OBLIGATIONS and custom role obligations from the DB to determine compliance obligation, rather than hardcoding role name lists. Also uses RESTRICTED_ROLES for the employee routing check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/api/src/people/people-invite.service.ts">
<violation number="1" location="apps/api/src/people/people-invite.service.ts:373">
P1: The new resend guard allows admin/owner roles because it checks compliance obligation instead of restricting to employee/contractor roles.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
claudfuen
pushed a commit
that referenced
this pull request
May 8, 2026
# [3.48.0](v3.47.0...v3.48.0) (2026-05-08) ### Bug Fixes * **people:** default portal email checkbox to checked, respect user choice ([#2806](#2806)) ([c413a9a](c413a9a)) * **people:** restore isActive when re-inviting deactivated contractor ([#2801](#2801)) ([871d706](871d706)) ### Features * **people:** add option to trigger employee portal emails ([#2800](#2800)) ([42d06db](42d06db))
Contributor
|
🎉 This PR is included in version 3.48.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hasPublishedPoliciesauto-override — unchecking the checkbox now actually prevents the portal email from being sent.resendPortalInviteendpoint to reject non-employee/contractor members (admin/owner/auditor roles).Follow-up to #2800.
Test plan
🤖 Generated with Claude Code
Summary by cubic
Default the “Send portal invite email” checkbox to checked and make it respect the user’s choice. Switch invite/resend gating to RBAC-based compliance so only members with compliance obligations receive portal emails; aligns with Linear CS-72.
Bug Fixes
resendPortalInvitereturns 400 for members without compliance obligations.Refactors
BUILT_IN_ROLE_OBLIGATIONSand custom role obligations from the DB to detect compliance.RESTRICTED_ROLESto identify strictly-employee invites; removed hardcoded role checks.Written for commit 10bcffb. Summary will update on new commits.