permit_type

package
v1.4.1-beta Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AnyOne        = Special.Target("any", "所有人")
	All           = Special.Target("all", "所有人")
	TeamMember    = Special.Target("team_member", "团队成员")
	TeamMaster    = Special.Target("team_master", "团队负责人")
	ProjectMember = Special.Target("project_member", "系统成员")
	ProjectMaster = Special.Target("project_master", "系统负责人")
)

Functions

func CompleteLabels

func CompleteLabels(ctx context.Context, vs ...*Target)

Types

type PermitType

type PermitType int
const (
	Invalid PermitType = iota
	Role
	// Special 专属
	Special
	// UserGroup 用户组
	UserGroup
	// User 用户
	User
)

func Parse

func Parse(v string) PermitType

func (PermitType) KeyOf

func (p PermitType) KeyOf(v string) string

func (PermitType) MarshalJSON

func (p PermitType) MarshalJSON() ([]byte, error)

func (PermitType) Name

func (p PermitType) Name() string

func (PermitType) Tag

func (p PermitType) Tag() string

func (PermitType) Target

func (p PermitType) Target(name string, label string) *Target

type Target

type Target struct {
	Key   string     `json:"key"`
	Type  PermitType `json:"type"`
	Name  string     `json:"name"`
	Label string     `json:"label"`
	Tag   string     `json:"tag"`
}

func TargetOf

func TargetOf(key string) *Target

func TargetsOf

func TargetsOf(ks ...string) []*Target

Jump to

Keyboard shortcuts

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