type
CollectionAccess
Access rules for collection admin, create, read, update, delete, and unlock operations.
Example
var Posts = ridu.Collection{
Access: ridu.CollectionAccess{
Create: authenticated,
Read: publishedOrOwner,
Update: ownerOrEditor,
Delete: administratorsOnly,
},
}Properties
| Property | Type | Description |
|---|---|---|
Admin | AccessRule | Control entry to the admin for this auth collection. |
Create | AccessRule | Control document creation. |
Read | AccessRule | Control and optionally filter reads. |
ReadVersions | AccessRule | Control version-history reads; defaults to Read. |
ReadDrafts | AccessRule | ReadDrafts controls whether an actor sees draft documents of a versioned collection, in addition to Read. It accepts only Allow or Deny. When omitted, only editors do: users of the admin's user collection whose Admin rule lets them in. Anonymous callers and an app's other auth collections read published content, and their explicit draft reads fail. |
Reference | AccessRule | Reference controls which documents of this collection other documents may point at through relationship and upload fields, and may return a Where decision. When omitted, Read is used. Set it to let actors link to documents they may not read, such as sending a friend request to a learner whose profile is private; population still applies Read. |
Update | AccessRule | Control and optionally filter updates. |
Publish | AccessRule | Control publishing and atomic published edits; defaults to Update. |
Unpublish | AccessRule | Control moving published documents to draft; defaults to Update. |
Delete | AccessRule | Control and optionally filter deletion. |
Unlock | AccessRule | Control takeover of another editor's lock; defaults to Update. |