access

package
v1.0.48 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gate

type Gate interface {
	WithContext(ctx context.Context) Gate
	Allows(ability string, arguments map[string]any) bool
	Denies(ability string, arguments map[string]any) bool
	Inspect(ability string, arguments map[string]any) *Response
	Define(ability string, callback func(ctx context.Context, arguments map[string]any) *Response)
	Any(abilities []string, arguments map[string]any) bool
	None(abilities []string, arguments map[string]any) bool
	Before(callback func(ctx context.Context, ability string, arguments map[string]any) *Response)
	After(callback func(ctx context.Context, ability string, arguments map[string]any, result *Response) *Response)
}

type Response

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

func NewAllowResponse

func NewAllowResponse() *Response

func NewDenyResponse

func NewDenyResponse(message string) *Response

func (Response) Allowed

func (r Response) Allowed() bool

func (Response) Message

func (r Response) Message() string

Jump to

Keyboard shortcuts

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