access

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VIEW uint16 = 2 << iota
	DISABLE
	REMOVE
	EDIT
	CREATE
	GET
	POST
	GRANT
	ALL         = ^uint16(0) // 65535
	NONE uint16 = 0          // 无权限
)

操作列表

Variables

View Source
var (
	AccessNames = map[uint16]string{
		VIEW: "view", DISABLE: "disable", REMOVE: "remove",
		EDIT: "edit", CREATE: "create", GET: "get", POST: "post",
		GRANT: "grant", ALL: "all", NONE: "",
	}
	AccessTitles = map[uint16]string{
		VIEW: "查看", DISABLE: "禁用", REMOVE: "删除",
		EDIT: "编辑", CREATE: "新建", GET: "GET", POST: "POST",
		GRANT: "授权", ALL: "全部", NONE: "无",
	}
)

Functions

func ContainAction

func ContainAction(perm, act uint16, strict bool) bool

func GetPermTitles

func GetPermTitles(codes []uint16) (titles []string)

找出权限的中文名称

func ParsePermNames

func ParsePermNames(perm uint16) (codes []uint16, names []string)

分解出具体权限

Types

This section is empty.

Jump to

Keyboard shortcuts

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