type

AccessContext

Actor, target, locale, data, and nested API supplied to an access rule.

Example

go
func ownerOnly(ctx ridu.AccessContext) (ridu.AccessDecision, error) {
  if ctx.Actor == nil {
    return ridu.Deny(), nil
  }
  return ridu.Where(query.Equal("author", ctx.Actor.ID)), nil
}

Properties

PropertyTypeDescription
Contextcontext.ContextRequest cancellation and deadline context.
Operationoperation.KindThe operation being authorized.
CollectionIDschema.StableIDTarget collection identity.
GlobalIDschema.StableIDTarget global identity, when applicable.
IDstringCurrent document ID; empty for create and list.
Actor*store.DocumentAuthenticated actor, or nil.
ActorCollectionschema.CollectionSlugThe exact auth collection that owns Actor.
Datastore.ValuesDetached incoming values for writes.
Local*LocalAPINested operations in the active transaction.
Localeschema.LocaleCodeSelected locale.
AllLocalesboolWhether every locale is selected.

How it works

Use the root alias in application configuration.

Full signature