ac

package
v0.0.0-...-19e0465 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind

func Bind(path string, f AC)

func CheckForController

func CheckForController(ctx context.Context, acs ...AC) (pass bool, err error)

CheckForController 接口访问的鉴权,有一个通过即可

func CheckForModel

func CheckForModel(ctx context.Context, acmap map[string]AC, action string, fields ...string) (removes []string, err error)

CheckForModel 数据层的鉴权,执行全部并返需要移除的无权限的字段

func CheckForView

func CheckForView(ctx context.Context, paths ...string) (removes []string, err error)

CheckForView 视图访问的鉴权,执行全部并返回需要移除的无权限的路径

func GetAll

func GetAll() map[string]AC

Types

type AC

type AC func(ctx context.Context) (pass bool, err error)

func Get

func Get(path string) AC

Jump to

Keyboard shortcuts

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