role

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Map = map[string]Role{
	"none":    None,
	"guest":   Guest,
	"viewer":  Viewer,
	"editor":  Editor,
	"manager": Manager,
	"owner":   Owner,
}

Functions

This section is empty.

Types

type Role

type Role int64
const (
	None Role = iota
	Guest
	Viewer
	Editor
	Manager
	Owner
)

func RoleFromString

func RoleFromString(str string) (Role, bool)

func (Role) Implies

func (s Role) Implies(requiredRole Role) bool

Implies returns true if this Role implies the given requiredRole and false otherwise. That is, if a user has this Role and an action requires requiredRole, this method returns true if the user can perform the operation and false if they cannot.

func (Role) String

func (s Role) String() string

Jump to

Keyboard shortcuts

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