permission

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 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 CheckAnyRole added in v0.2.17

func CheckAnyRole(roleId uint64) bool

func CheckRole added in v0.0.3

func CheckRole(roleId uint64, permission Enum) bool

CheckRole 检查某人是否有某权限

func InvalidateRole added in v0.2.11

func InvalidateRole(roleId uint64)

Types

type Enum

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

func All added in v0.2.17

func All() []Enum

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