policy

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize()

func Middleware

func Middleware(policy Policier, action Action) gin.HandlerFunc

Types

type Action

type Action byte
const (
	ActionCreate Action = iota
	ActionUpdate
	ActionDelete
	ActionForceDelete
	ActionView
	ActionRestore
)

type NotFoundError

type NotFoundError struct{}

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Policier

type Policier interface {
	Before() *bool
	Create(userIF model.IUser) bool
	Update(userIF model.IUser) bool
	Delete(userIF model.IUser) bool
	ForceDelete(userIF model.IUser) bool
	View(userIF model.IUser) bool
	Restore(userIF model.IUser) bool
}

type RoutePolicier

type RoutePolicier interface {
	Can(policy Policier, action Action)
}

type UserNotPermitError

type UserNotPermitError struct{}

func (UserNotPermitError) Error

func (e UserNotPermitError) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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