feat(admin-api): expose notification_preferences as read-only

Resolve the earlier open question by mapping the profile-settings
domain's notification toggles to the existing notification_preferences
table (primary key user_id, no sensitive columns). Read-only, gated on
view_users, with a test covering read access and rejected writes.
This commit is contained in:
jjbrunton committed 2026-08-30 19:04:54 +01:00
1 parent 77f2718fdd
commit 25b7c6238e
2 files changed
+16

No files matched your search

+1
View File
@@ -40,6 +40,7 @@ const resources: Record<string, ResourceRule> = {
quiz_answers: { read: ['view_users', 'view_activity'] },
sent_dares: { read: ['view_users', 'view_activity', 'view_chats'] },
dare_messages: { read: ['view_chats', 'view_activity'] },
notification_preferences: { read: 'view_users', idColumn: 'user_id' },
};
function identifier(value: string): string {