acl

package
v0.0.0-...-afa4d9b Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpRead = iota
	OpWrite
	OpPeer
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Identity string
	Path     string
	Op       Op
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func Load

func Load(path string) (*Manager, error)

Load ACL rules from a text file. The file should contain one rule per line, either:

<identity> <path> <op(READ|WRITE)>

or:

<identity> <op(PEER)>

(PEER ACLs have no path). Empty lines and lines starting with a # are ignored.

func NewManager

func NewManager(acls []Entry) *Manager

func (*Manager) Check

func (m *Manager) Check(identity string, op Op, path string) bool

type NullManager

type NullManager struct{}

func NewNullManager

func NewNullManager() *NullManager

func (*NullManager) Check

func (m *NullManager) Check(identity string, op Op, path string) bool

type Op

type Op int

func (Op) String

func (op Op) String() string

Jump to

Keyboard shortcuts

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