rules

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const Star = "*"

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	User   string `json:"user"`   // can be a `userID` or `*` (means all)
	Op     string `json:"op"`     // can be a `specific operation` or `*` (means all)
	Target string `json:"target"` // can be a `specific target id` or `*` (means all)
	Tbl    string `json:"tbl"`    // can be a `specific table` or `*` (means all)
	Allow  bool   `json:"allow"`
}

type ACLs

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

func New

func New(source []ACL) *ACLs

func (*ACLs) Allow

func (a *ACLs) Allow(filters ...IFilter) bool

type IFilter

type IFilter func(ACL) bool

func ByOp

func ByOp(op string) IFilter

func ByTable

func ByTable(tbl string) IFilter

func ByTargetID

func ByTargetID(tid string) IFilter

func ByUserID

func ByUserID(uid string) IFilter

Jump to

Keyboard shortcuts

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