Skip to main content
Field Access Control is Access Control used to restrict access to specific Fields within a Document. To add Access Control to a Field, use the access property in your Field Config:
Field Access Control does not support returning Query constraints like Collection Access Control does.

Config Options

Access Control is specific to the operation of the request. To add Access Control to a Field, use the access property in the Field Config:
The following options are available: 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. If false 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. If false, 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. If false 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: