rbac

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package rbac provides an explicit, durable, default-deny RBAC Adapter.

Stability: alpha. Consumers should pin an exact pre-v1 Modary version.

Index

Constants

View Source
const ModuleID = "rbac"

ModuleID is the stable Module manifest and migration owner identifier.

Variables

View Source
var ErrContextRequired = errors.New("RBAC context is required")

ErrContextRequired reports a nil authorization context.

Functions

func Module

func Module(options Options) (module.Registration, error)

Module returns a pure Registration after validating and copying Options.

Types

type Binding

type Binding struct {
	ActorID   string
	ActorType string
	Scope     scope.Execution
	RoleID    string
}

Binding assigns a role to one exact actor and execution scope.

type Options

type Options struct {
	Roles           []Role
	Bindings        []Binding
	RevokedRoleIDs  []string
	RevokedBindings []Binding
}

Options is an explicit provisioning and revocation patch. Empty Options installs schema and a default-deny Authorizer; omitted durable policy remains unchanged.

type Role

type Role struct {
	ID          string
	Permissions []string
	MaxRows     int
}

Role grants a set of exact permissions. MaxRows zero is unbounded. When several roles grant the same permission, the least restrictive bound wins; any unbounded granting role makes the effective grant unbounded.

Jump to

Keyboard shortcuts

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