Permission by email



I’m having troubles coming up with a permissions check for a particular case. Say I have 2 types:

type Something @model {
  id: ID! @isUnique
  someEmail: String  

type User @model {
  id: ID! @isUnique
  email: String

Where User may or may not exist when someEmail from Something is assigned a value. The user will get an email notifying them when they have been added to Something, then register.

When the user registers I want them to be able to see the Something data if their email is set in someEmail. Is there a way to do this?

The only other way I can think of doing this is to add the user to Something as an association. Then as a post registration step assign the User to the user field for all Something types that have their email defined in the field someEmail for Something.


Maybe have a look at DocumentAccess in this thread to see if it helps: Help on permission filters