access

package
v0.0.0-...-af2e488 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 25 Imported by: 4

Documentation

Overview

Package access adapts the generic ACL policy store contract to the Datly v1 resource policy components. Every read and write executes the generated studio/resource_policy reader and writer in-process; this package owns no SQL and opens no transactions of its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	DB *sql.DB
	// Invoker keeps native access reads/writes inside the caller's Datly
	// database unit. Standalone SDK hosts leave it nil and use the local runtime.
	Invoker dexec.ComponentInvoker
	// contains filtered or unexported fields
}

Store hosts the resource policy components against one Studio database. DB is the "authz" connector the generated components declare.

func (*Store) Close

func (s *Store) Close(ctx context.Context) error

Close releases the hosted component runtime.

func (*Store) Create

func (s *Store) Create(ctx context.Context, doc acl.Document, actor string) (acl.Document, error)

Create adds a first revision through the native policy writer.

func (*Store) Get

func (s *Store) Get(ctx context.Context, r acl.Resource) (acl.Document, error)

Get executes the generated reader for one exact resource identity. Every key dimension is a required predicate, so a missing head yields no row.

func (*Store) Provision

func (s *Store) Provision(ctx context.Context, d acl.Document, actor string) (acl.Document, error)

Provision is a server bootstrap operation, intentionally absent from the ACL service and client API. It cannot replace an existing policy.

func (*Store) Replace

func (s *Store) Replace(ctx context.Context, d acl.Document, expected int64, actor string) (acl.Document, error)

Replace activates a new revision only when the caller's expected revision is the current head.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL