acl

package
v2.24.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// LongTextForm contains one ACL entry per line.
	LongTextForm = "\n"
	// ShortTextForm is a sequence of ACL entries separated by commas, and is used for input.
	ShortTextForm = ","

	// TypeUser indicates the qualifier identifies a user
	TypeUser = "u"
	// TypeLightweight indicates the qualifier identifies a lightweight user
	TypeLightweight = "lw"
	// TypeGroup indicates the qualifier identifies a group
	TypeGroup = "egroup"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ACLs

type ACLs struct {
	Entries []*Entry
	// contains filtered or unexported fields
}

The ACLs represent a delimiter separated list of ACL entries.

func Parse

func Parse(acls string, delimiter string) (*ACLs, error)

Parse parses an acl string with the given delimiter (LongTextForm or ShortTextForm)

func (*ACLs) DeleteEntry

func (m *ACLs) DeleteEntry(aclType string, qualifier string)

DeleteEntry removes an entry uniquely identified by acl type and qualifier

func (*ACLs) Serialize

func (m *ACLs) Serialize() string

Serialize always serializes to short text form

func (*ACLs) SetEntry

func (m *ACLs) SetEntry(aclType string, qualifier string, permissions string) error

SetEntry replaces the permissions of an entry with the given set

type Entry

type Entry struct {
	// an ACL entry tag type: user, group, mask or other. comments start with #
	Type string
	// an ACL entry qualifier
	Qualifier string
	// and the discretionary access permissions
	Permissions string
}

The Entry of an ACL is represented as three colon separated fields:

func ParseEntry

func ParseEntry(singleSysACL string) (*Entry, error)

ParseEntry parses a single ACL

func ParseLWEntry

func ParseLWEntry(singleSysACL string) (*Entry, error)

ParseLWEntry parses a single lightweight ACL

func (*Entry) CitrineSerialize

func (a *Entry) CitrineSerialize() string

CitrineSerialize serializes an ACL entry for citrine EOS ACLs

Jump to

Keyboard shortcuts

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