type

CollectionAccess

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

Source ridu.go:66

AdminAccessRule
Control entry to the admin for this auth collection.
CreateAccessRule
Control document creation.
ReadAccessRule
Control and optionally filter reads.
ReadVersionsAccessRule
Control version-history reads; defaults to Read.
UpdateAccessRule
Control and optionally filter updates.
PublishAccessRule
Control publishing and atomic published edits; defaults to Update.
UnpublishAccessRule
Control moving published documents to draft; defaults to Update.
DeleteAccessRule
Control and optionally filter deletion.
UnlockAccessRule
Control takeover of another editor's lock; defaults to Update.

Example

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