filter

package
v1.28.6 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterFn

type FilterFn[T any] func(item T) string

FilterFn defines a function that generates authorization resources for an item

type ResourceFilter

type ResourceFilter[T any] struct {
	// contains filtered or unexported fields
}

ResourceFilter handles filtering resources based on authorization

func New

func New[T any](authorizer authorization.Authorizer, config config.Config) *ResourceFilter[T]

func (*ResourceFilter[T]) Filter

func (f *ResourceFilter[T]) Filter(
	logger logrus.FieldLogger,
	principal *models.Principal,
	items []T,
	verb string,
	resourceFn FilterFn[T],
) []T

Filter filters a slice of items based on authorization

Jump to

Keyboard shortcuts

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