access

package
v1.0.0-...-a0f063d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 3 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 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.IResponse) access.IResponse)

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.IResponse)

func (*Gate) Define

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

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.IResponse

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.IGate

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