type

CollectionAccess

Access rules for collection admin, create, read, update, delete, and unlock operations.

Example

go
var Posts = ridu.Collection{
  Access: ridu.CollectionAccess{
    Create: authenticated,
    Read:   publishedOrOwner,
    Update: ownerOrEditor,
    Delete: administratorsOnly,
  },
}

Properties

PropertyTypeDescription
AdminAccessRuleControl entry to the admin for this auth collection.
CreateAccessRuleControl document creation.
ReadAccessRuleControl and optionally filter reads.
ReadVersionsAccessRuleControl version-history reads; defaults to Read.
ReadDraftsAccessRuleReadDrafts 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.
ReferenceAccessRuleReference 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.
UpdateAccessRuleControl and optionally filter updates.
PublishAccessRuleControl publishing and atomic published edits; defaults to Update.
UnpublishAccessRuleControl moving published documents to draft; defaults to Update.
DeleteAccessRuleControl and optionally filter deletion.
UnlockAccessRuleControl takeover of another editor's lock; defaults to Update.

Full signature