authz

package
v3.33.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GroupPermissions

type GroupPermissions struct {
	Permissions map[string]map[string]Permission `yaml:"user-groups"`
	Admin       string                           `yaml:"admin"`
}

func (*GroupPermissions) GetAuthorizedIndexList

func (p *GroupPermissions) GetAuthorizedIndexList(groups []authn.Group, desiredPermission Permission) (indexList []string)

func (*GroupPermissions) GetPermissions

func (p *GroupPermissions) GetPermissions(user *authn.UserInfo, index string) (permission Permission, errors error)

func (*GroupPermissions) IsAdmin

func (p *GroupPermissions) IsAdmin(groups []authn.Group) bool

func (*GroupPermissions) ReadPermissionsFile

func (p *GroupPermissions) ReadPermissionsFile(permsFile io.Reader) (err error)

type Permission

type Permission string
const (
	None  Permission = ""
	Read  Permission = "read"
	Write Permission = "write"
	Admin Permission = "admin"
)

func (Permission) Satisfies

func (p Permission) Satisfies(b Permission) bool

Satisfies returns whether `p` satisfies the permissions required by `b`

Jump to

Keyboard shortcuts

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