smallbets / userbase

Create secure and private web apps using only static JavaScript, HTML, and CSS.

Home Page:https://userbase.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Save timestamp when sharing users with a database

Fubinator opened this issue · comments

It can be helpful to know since when a user has a certain shared database. A use case would be: There are notifications on a database level. If I add a user to a database that exists for example for 3 years with hundreds or even thousands of records, he should not get these notifications from old entries. The easiest way for me would be to filter out all notifications that were created before his timestamp when the database was shared with him.

This could be implemented into getDatabases where the users for each database are returned in the users array. An example for an entry of the users array would be:

{ 
  username: "testuser",
  isOwner: false,
  readOnly: false,
  resharingAllowed: false,
  receivedFromUsername: "TestOwner",
  dateShared: "2020-11-02T13:42:11.589Z"
}