Skip to content

Admin enabled senders group - #50

Merged
ddbruce merged 3 commits into
mainfrom
admin-enabled-senders-group
Aug 9, 2026
Merged

Admin enabled senders group#50
ddbruce merged 3 commits into
mainfrom
admin-enabled-senders-group

Conversation

@ddbruce

@ddbruce ddbruce commented Aug 9, 2026

Copy link
Copy Markdown
Member

No description provided.

ddbruce and others added 3 commits August 9, 2026 15:09
Introduce a dynamic recipient group, available only to admins, that
targets enabled sender contacts (contacts.user_id NOT NULL AND
contacts.enabled = 1). It rides the existing group-selection plumbing
via a "senders" sentinel id and requires no schema change.

- groups.js: enabled-senders queries; sentinel handling in
  getContactsInGroup, getNumbersinGroup, and getContactsInMultipleGroups
  (unions + dedupes senders with real groups).
- auth.js: extract hasAdminRole(req) boolean helper from isAdmin.
- server.js: enforce admin on the senders group in
  /api/group/:group/contacts, /api/groups/contacts, /api/messages/send.
- messages.js: record senders in messages_contacts (no groups row to
  reference in messages_groups); guard against duplicate contact logging.
- fullsend.js: show the "Enabled senders" switch only to admins.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ddbruce
ddbruce merged commit 2b29afa into main Aug 9, 2026
1 check failed
@ddbruce
ddbruce deleted the admin-enabled-senders-group branch August 9, 2026 19:11
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.

1 participant