relationships

package
v1.22.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateOneRelationship added in v1.22.0

func ValidateOneRelationship(
	namespaceMap map[string]*namespace.TypeSystem,
	caveatMap map[string]*core.CaveatDefinition,
	rel *core.RelationTuple,
) error

func ValidateRelationships added in v1.22.0

func ValidateRelationships(
	ctx context.Context,
	reader datastore.Reader,
	rels []*core.RelationTuple,
) error

ValidateRelationships performs validation on the given relationships, ensuring that they can be applied against the datastore.

Types

type ErrCannotWriteToPermission

type ErrCannotWriteToPermission struct {
	// contains filtered or unexported fields
}

ErrCannotWriteToPermission indicates that a write was attempted on a permission.

func NewCannotWriteToPermissionError

func NewCannotWriteToPermissionError(update *core.RelationTuple) ErrCannotWriteToPermission

NewCannotWriteToPermissionError constructs a new error for attempting to write to a permission.

func (ErrCannotWriteToPermission) GRPCStatus

func (err ErrCannotWriteToPermission) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

type ErrCaveatNotFound

type ErrCaveatNotFound struct {
	// contains filtered or unexported fields
}

ErrCaveatNotFound indicates that a caveat referenced in a relationship update was not found.

func NewCaveatNotFoundError

func NewCaveatNotFoundError(update *core.RelationTuple) ErrCaveatNotFound

NewCaveatNotFoundError constructs a new caveat not found error.

func (ErrCaveatNotFound) GRPCStatus

func (err ErrCaveatNotFound) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

type ErrInvalidSubjectType

type ErrInvalidSubjectType struct {
	// contains filtered or unexported fields
}

ErrInvalidSubjectType indicates that a write was attempted with a subject type which is not allowed on relation.

func NewInvalidSubjectTypeError

func NewInvalidSubjectTypeError(update *core.RelationTuple, relationType *core.AllowedRelation) ErrInvalidSubjectType

NewInvalidSubjectTypeError constructs a new error for attempting to write an invalid subject type.

func (ErrInvalidSubjectType) GRPCStatus

func (err ErrInvalidSubjectType) GRPCStatus() *status.Status

GRPCStatus implements retrieving the gRPC status for the error.

Jump to

Keyboard shortcuts

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