auth

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReadOperation  operationType = "read"
	WriteOperation operationType = "write"
)

Variables

This section is empty.

Functions

func CheckAttributePermissions

func CheckAttributePermissions[ID comparable, S AttributePermissionsAuthorizer[ID]](
	ctx context.Context,
	attrType entry.AttributeType,
	attrStore S,
	targetID ID,
	userID umid.UMID,
	opType operationType,

) (bool, error)

Check authorization for an operation on an plugin attribute.

func CheckReadAllPermissions

func CheckReadAllPermissions[ID comparable, T AttributePermissionsAuthorizer[ID]](
	ctx context.Context,
	attrType entry.AttributeType,
	attrStore T,
	userID umid.UMID,
) (bool, error)

Check if user is authorized to read all attributes.

Types

type AttributePermissionsAuthorizer

type AttributePermissionsAuthorizer[T comparable] interface {
	universe.AttributeUserRoleGetter[T]
	universe.AttributeOptionsGetter[T]
}

Interface plugin attributes need to implement for authorization.

Jump to

Keyboard shortcuts

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