access property in your Field Config:
Config Options
Access Control is specific to the operation of the request. To add Access Control to a Field, use theaccess property in the Field Config:
Each function returns
boolean or Promise<boolean>. Field access functions don’t accept queries. They don’t run when an operation sets overrideAccess: true.
Create
Returns a boolean which allows or denies the ability to set a field’s value when creating a new document. Iffalse is returned, any passed values will be discarded.
Available argument properties:
Read
Returns a boolean which allows or denies the ability to read a field’s value. Iffalse, the entire property is omitted from the resulting document.
Available argument properties:
Update
Returns a boolean which allows or denies the ability to update a field’s value. Iffalse is returned, any passed values will be discarded.
If false is returned and you attempt to update the field’s value, the operation will not throw an error however the field will be omitted from the update operation and the value will remain unchanged.
Available argument properties: