permission

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoTree added in v0.11.0

type NoTree struct{}

func (NoTree) Resolve added in v0.11.0

func (NoTree) Resolve(perms []string) ([]string, error)

type Resolver added in v0.11.0

type Resolver interface {
	Resolve([]string) ([]string, error)
}

type Tree

type Tree map[string]Tree

```yaml permissions:

users:
	write:
		- owner
	read:

pets:
	- write
	- read

```

Output:

tree := Tree{
	"users": {
		"write": {
			"owner": {}
		},
		"read": {}
	},
	"pets": {
		"write": {},
		"read": {},
	}
}

Identifiers:

users:write users:write:owner users:read pets:write pets:read

Resolving:

func (Tree) Insert

func (t Tree) Insert(path string)

func (Tree) InsertPath

func (t Tree) InsertPath(path []string)

func (Tree) IsFinalLeave

func (t Tree) IsFinalLeave() bool

IsFinalLeave returns true if this tree node is the final leave. That means that there are not further sub-permissions for this node.

func (Tree) MergeFrom

func (t Tree) MergeFrom(another Tree) Tree

func (Tree) Resolve

func (t Tree) Resolve(perms []string) ([]string, error)

func (*Tree) UnmarshalJSON

func (tn *Tree) UnmarshalJSON(blob []byte) error

UnmarshalJSON implements the encoding/json.Unmarshaler interface and adds support to parse a Tree node from an object (Tree) or string list.

Jump to

Keyboard shortcuts

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