permission

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOptions

func BuildOptions() []datastruct.Option[string, Enum]

func CheckRole added in v0.0.3

func CheckRole(roleId uint64, permission Enum) bool

CheckRole 检查某人是否有某权限

Types

type Enum

type Enum int
const (
	Admin Enum = iota
	UserManager
	ArticlesManager
	PageManager
	RoleManager
	SiteManager
)

func GetPermission

func GetPermission(roleIds []uint64) []Enum

GetPermission 获取权限 (兼容旧接口)

func GetPermissionByRoleId added in v0.1.1

func GetPermissionByRoleId(roleId uint64) []Enum

GetPermissionByRoleId 获取单个角色的权限(带缓存)

func (Enum) Id

func (receiver Enum) Id() uint64

func (Enum) Name

func (receiver Enum) Name() string

Jump to

Keyboard shortcuts

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