perm

package
v0.0.0-...-d2a29bb Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAccessMode = util.NewInvalidArgumentErrorf("Invalid access mode")

ErrInvalidAccessMode is returned when an invalid access mode is used

Functions

This section is empty.

Types

type AccessMode

type AccessMode int

AccessMode specifies the users access mode

const (
	AccessModeNone AccessMode = iota // 0: no access

	AccessModeRead  // 1: read access
	AccessModeWrite // 2: write access
	AccessModeAdmin // 3: admin access
	AccessModeOwner // 4: owner access
)

func ParseAccessMode

func ParseAccessMode(permission string, allowed ...AccessMode) AccessMode

ParseAccessMode returns corresponding access mode to given permission string.

func (AccessMode) LogString

func (mode AccessMode) LogString() string

func (AccessMode) ToString

func (mode AccessMode) ToString() string

ToString returns the string representation of the access mode, do not make it a Stringer, otherwise it's difficult to render in templates

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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