authz

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationMkdir  = "mkdir"
	OperationOpen   = "open"
	OperationRemove = "remove"
	OperationRename = "rename"
	OperationStat   = "stat"
)

Variables

This section is empty.

Functions

func WithContextUser

func WithContextUser(parent context.Context, user User) context.Context

Types

type FileSystem

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

func NewFileSystem

func NewFileSystem(backend webdav.FileSystem) *FileSystem

func (*FileSystem) Mkdir

func (f *FileSystem) Mkdir(ctx context.Context, name string, perm os.FileMode) error

Mkdir implements webdav.FileSystem.

func (*FileSystem) OpenFile

func (f *FileSystem) OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (webdav.File, error)

OpenFile implements webdav.FileSystem.

func (*FileSystem) RemoveAll

func (f *FileSystem) RemoveAll(ctx context.Context, name string) error

RemoveAll implements webdav.FileSystem.

func (*FileSystem) Rename

func (f *FileSystem) Rename(ctx context.Context, oldName string, newName string) error

Rename implements webdav.FileSystem.

func (*FileSystem) Stat

func (f *FileSystem) Stat(ctx context.Context, name string) (os.FileInfo, error)

Stat implements webdav.FileSystem.

type Group

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

func NewGroup

func NewGroup(name string, rules ...Rule) *Group

func (*Group) Name

func (g *Group) Name() string

func (*Group) Rules

func (g *Group) Rules() []Rule

Rules implements Rules.

type Operation

type Operation string

type Rule

type Rule interface {
	Exec(env map[string]any) (bool, error)
}

type Rules

type Rules interface {
	Rules() []Rule
}

type User

type User interface {
	Attrs() map[string]any
	Rules() []Rule
	Groups() []*Group
}

func ContextUser

func ContextUser(ctx context.Context) (User, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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