perm

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddPerm

func AddPerm(pm *Perm)

func GetGroups

func GetGroups(prefix string) []string

Types

type Perm

type Perm struct {
	PermValue

	Group   string `json:"group"`
	Desc    string `json:"desc"`
	IsAdmin bool   `json:"-"`
}

func AllPerm

func AllPerm(full bool) []*Perm

func FindPerm

func FindPerm(pv *PermValue) *Perm

func NewAdminPerm

func NewAdminPerm(grp, desc, val string) *Perm

func NewPerm

func NewPerm(grp, desc, val string) *Perm

func NewPermValue

func NewPermValue(val string) *Perm

type PermCache

type PermCache interface {
	Get(uid uuid.UUID, c *gin.Context) []*PermValue
	Has(uid uuid.UUID, val *PermValue, c *gin.Context) bool
}

func NewPermCache

func NewPermCache() PermCache

type PermValue

type PermValue struct {
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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