fileperm

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	Regexpress bool
	Writeable  *bool
	Readable   bool
	Path       string
	// contains filtered or unexported fields
}

func NewRule

func NewRule(path string, readable bool, writeable *bool, regexpress bool) *Rule

func NewRuleAndInit

func NewRuleAndInit(path string, readable bool, writeable *bool, regexpress bool) (*Rule, error)

func (*Rule) FixedPathPrefixAndSuffix

func (r *Rule) FixedPathPrefixAndSuffix(hasPrefix, hasSuffix bool) string

func (*Rule) Init

func (r *Rule) Init() (err error)

func (*Rule) SetPath

func (r *Rule) SetPath(path string) *Rule

func (*Rule) SetWriteable

func (r *Rule) SetWriteable(on bool) *Rule

type Rules

type Rules []*Rule

func ParseForm

func ParseForm(ctx echo.Context) (rules Rules, err error)

func (*Rules) Add

func (s *Rules) Add(r *Rule) (err error)

func (*Rules) Init

func (s *Rules) Init() (err error)

func (Rules) IsEmpty

func (s Rules) IsEmpty() bool

func (Rules) JSONBytes

func (s Rules) JSONBytes() ([]byte, error)

func (Rules) JSONString

func (s Rules) JSONString() (string, error)

func (Rules) Len

func (s Rules) Len() int

func (Rules) Less

func (s Rules) Less(i, j int) bool

func (Rules) SetForm

func (s Rules) SetForm(ctx echo.Context)

func (Rules) Swap

func (s Rules) Swap(i, j int)

type User

type User struct {
	Writeable bool   // 是否默认可写
	RootDir   string // 跟路径
	Rules     Rules
}

func (User) Allowed

func (u User) Allowed(path string, modification bool) bool

Allowed checks if the user has permission to access a directory/file

Jump to

Keyboard shortcuts

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