Conversation
…2669) * fix(api): scope task status-change emails to assignee, not whole org notifyStatusChange and notifyBulkStatusChange were emailing every non-platform-admin member of the org on any task status change, then leaning on isUserUnsubscribed to filter. That filter had gaps (multi-role users, custom roles, unsaved matrix state), so employees with "Task Assignments" unchecked still received status-change emails. Now: - Single status change: emails only the task's assignee. If the task has no assignee, falls back to owners + admins. Actor always excluded, isUserUnsubscribed still honored. - Bulk status change: groups tasks by assignee and sends each one a bulk email with the count of THEIR tasks. Unassigned tasks are routed to owners/admins with the unassigned count. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(roles): add permission-based member filter helper RolesService.filterMembersWithPermission(orgId, members, resource, action) returns the subset of members whose combined (built-in + custom) role permissions grant the requested resource:action. One batched organizationRole.findMany query regardless of member count. Matches better-auth's hasPermissionFn semantics: comma-separated role strings treated as a union; unknown role names skipped silently. Uses BUILT_IN_ROLE_PERMISSIONS (derived from the same role.statements that better-auth initializes with) so answers stay in lockstep with the runtime permission guard. Enables upcoming migration of notifier recipient selection from hardcoded role-string matching (role.includes('admin')) to permission-based filtering — so custom roles like "Compliance Manager" with task:update automatically qualify. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Contributor
|
🎉 This PR is included in version 3.33.1 🎉 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.
This is an automated pull request to release the candidate branch into production, which will trigger a deployment.
It was created by the [Production PR] action.
Summary by cubic
Scopes task status-change emails to the right people and adds a permission-based member filter for future notification logic. Reduces noisy emails and ensures the actor isn’t notified.
Bug Fixes
New Features
RolesService.filterMembersWithPermission(orgId, members, resource, action)to return members granted a specificresource:actionvia built-in or custom roles with one batched query; supports comma-separated roles.Written for commit fd0aa1c. Summary will update on new commits.