domain

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Domain

type Domain interface {
	AddRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error)
	RemoveRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) error
	RemoveRoleBindingsForResource(ctx context.Context, resourceRef string) error
	UpdateRoleBinding(ctx context.Context, rb entities.RoleBinding) (*entities.RoleBinding, error)

	GetRoleBinding(ctx context.Context, userId repos.ID, resourceRef string) (*entities.RoleBinding, error)

	ListRoleBindingsForResource(ctx context.Context, resourceType t.ResourceType, resourceRef string) ([]*entities.RoleBinding, error)
	ListRoleBindingsForUser(ctx context.Context, userId repos.ID, resourceType *t.ResourceType) ([]*entities.RoleBinding, error)

	Can(ctx context.Context, userId repos.ID, resourceRefs []string, action t.Action) (bool, error)
}

func NewDomain

func NewDomain(rbRepo repos.DbRepo[*entities.RoleBinding], roleBindingMap map[t.Action][]t.Role) Domain

type UnAuthorizedError

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

func (UnAuthorizedError) Error

func (e UnAuthorizedError) Error() string

Jump to

Keyboard shortcuts

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