access

package
v1.13.10 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAllowResponse added in v1.13.1

func NewAllowResponse() access.Response

func NewDenyResponse added in v1.13.1

func NewDenyResponse(message string) access.Response

Types

type Gate

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

func NewGate

func NewGate(ctx context.Context) *Gate

func (*Gate) After

func (r *Gate) After(callback func(ctx context.Context, ability string, arguments map[string]any, result access.Response) access.Response)

func (*Gate) Allows

func (r *Gate) Allows(ability string, arguments map[string]any) bool

func (*Gate) Any

func (r *Gate) Any(abilities []string, arguments map[string]any) bool

func (*Gate) Before

func (r *Gate) Before(callback func(ctx context.Context, ability string, arguments map[string]any) access.Response)

func (*Gate) Define

func (r *Gate) Define(ability string, callback func(ctx context.Context, arguments map[string]any) access.Response)

func (*Gate) Denies

func (r *Gate) Denies(ability string, arguments map[string]any) bool

func (*Gate) Inspect

func (r *Gate) Inspect(ability string, arguments map[string]any) access.Response

func (*Gate) None

func (r *Gate) None(abilities []string, arguments map[string]any) bool

func (*Gate) WithContext

func (r *Gate) WithContext(ctx context.Context) access.Gate

type ResponseImpl added in v1.13.1

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

func (*ResponseImpl) Allowed added in v1.13.1

func (r *ResponseImpl) Allowed() bool

func (*ResponseImpl) Message added in v1.13.1

func (r *ResponseImpl) Message() string

Jump to

Keyboard shortcuts

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