Versions in this module Expand all Collapse all v0 v0.2.0 Jun 11, 2026 Changes in this version + var ErrConflict = errors.New("already exists") + var ErrNotFound = errors.New("not found") + type Operation struct + Name string + Resource string + type Resource struct + Name string + type Role struct + Name string + type RoleGrant struct + Operation string + Role string + Scope model.Scope + type Shared interface + CreateOperation func(name, resource string) error + CreateResource func(name string) error + DeleteOperation func(name string) error + DeleteResource func(name string) error + EnsureOperation func(name, resource string) error + EnsureResource func(name string) error + EnsureUser func(sub string) error + ListOperations func() ([]Operation, error) + ListResources func() ([]Resource, error) + ListUsers func() ([]User, error) + OperationExists func(name string) (bool, error) + type Stores struct + Shared Shared + func Open(cfg config.Storage) (*Stores, error) + func (s *Stores) Tenant(id string) (Tenant, bool) + func (s *Stores) TenantIDs() []string + type Tenant interface + AddRoleRestrictedIDs func(role, operation string, ids []string) error + AddUserRestrictedIDs func(sub, operation string, ids []string) error + AssignRole func(sub, role string) error + CreateRole func(name string) error + DeleteRole func(name string) error + EnsureRole func(name string) error + HasRolePermission func(role, operation string) (bool, error) + HasUserPermission func(sub, operation string) (bool, error) + ListRoles func() ([]Role, error) + RemoveRolePermission func(role, operation string) error + RemoveRoleRestrictedIDs func(role, operation string, ids []string) error + RemoveUserPermission func(sub, operation string) error + RemoveUserRestrictedIDs func(sub, operation string, ids []string) error + RenameRole func(name, newName string) error + RoleExists func(name string) (bool, error) + RoleGrants func(roles []string) ([]RoleGrant, error) + RolePermissions func(role string) ([]model.OperationScope, error) + RoleRestrictedIDs func(roles []string, operation string) ([]string, error) + SetRolePermission func(role, operation string, scope model.Scope) error + SetUserPermission func(sub, operation string, scope model.Scope) error + UnassignRole func(sub, role string) error + UserPermissions func(sub string) ([]model.OperationScope, error) + UserRestrictedIDs func(sub, operation string) ([]string, error) + UserRoles func(sub string) ([]string, error) + type User struct + Sub string v0.1.1 Jun 10, 2026