role_enum

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoleName

type RoleName string

RoleName определяет enum всех возможных ролей в системе

const (
	Admin     RoleName = "admin"
	Moderator RoleName = "moderator"
	User      RoleName = "user"
)

func AllRoles

func AllRoles() []RoleName

AllRoles возвращает список всех доступных ролей

func (RoleName) HasAccess

func (r RoleName) HasAccess(required RoleName) bool

func (RoleName) IsValid

func (r RoleName) IsValid() bool

IsValid проверяет, является ли значение допустимой ролью

func (RoleName) Level

func (r RoleName) Level() int

func (RoleName) String

func (r RoleName) String() string

String возвращает строковое представление роли

Jump to

Keyboard shortcuts

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