Skip to content
This repository has been archived by the owner on May 7, 2022. It is now read-only.

Horizon example: notifications #87

Open
deontologician opened this issue Jun 24, 2016 · 0 comments
Open

Horizon example: notifications #87

deontologician opened this issue Jun 24, 2016 · 0 comments

Comments

@deontologician
Copy link
Contributor

A simple notification scheme:

Users create documents in the 'notifications' collection.
Each document has a sender, receiver and read field
Permissions would be:

  • collection('notifications').store({sender: context.id, recipient: any(), read: false})
  • collection('notifications').findAll({ recipient: context.id }).anyRead()
  • collection('notifications').update({ recipient: context.id, read: any() })

Users create a changefeed like hz('notifications').findAll({recipient: userId}).watch(), and can do store to send a notification to another user, and update to mark their own notifications as read.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant