access

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAllowResponse

func NewAllowResponse() access.Response

func NewDenyResponse

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

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

func (*ResponseImpl) Allowed

func (r *ResponseImpl) Allowed() bool

func (*ResponseImpl) Message

func (r *ResponseImpl) Message() string

Jump to

Keyboard shortcuts

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