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 ¶
- func InvalidateNativePolicyReaders(ctx context.Context, db *sql.DB) error
- type RevisionSelections
- type Store
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) Create(ctx context.Context, doc acl.Document, actor string) (acl.Document, error)
- func (s *Store) Get(ctx context.Context, r acl.Resource) (acl.Document, error)
- func (s *Store) PolicyResources(ctx context.Context, tenant string) ([]authz.Resource, error)
- func (s *Store) Provision(ctx context.Context, d acl.Document, actor string) (acl.Document, error)
- func (s *Store) Replace(ctx context.Context, d acl.Document, expected int64, actor string) (acl.Document, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RevisionSelections ¶
RevisionSelections loads resource -> revisions -> one current policy document through Datly. Action identifies the policy to evaluate on each revision.
func (*RevisionSelections) GetSelection ¶
func (s *RevisionSelections) GetSelection(ctx context.Context, family acl.ResourceFamily) (acl.SelectionDocument, error)
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 NewTransactionStore ¶
NewTransactionStore creates an isolated native store for one caller-owned transaction. The trusted caller supplies its exact database handle. Neither this store nor its component runtime may commit/rollback or close that unit. A new transaction requires a new store; cached registrations are never rebound.
func (*Store) Get ¶
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) PolicyResources ¶
PolicyResources enumerates current policy identities from existing heads. It is used only by checked administration, never on the execution path.