voter

package
v3.0.0-alpha6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: OSL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessDecision

type AccessDecision int

AccessDecision defines access decision type which represents voter result

const (
	// AccessAbstained defines access decision in case voter is not responsible for permission
	AccessAbstained AccessDecision = iota
	// AccessGranted defines access decision in case when voter grants an access
	AccessGranted AccessDecision = iota
	// AccessDenied defines access decision in case when voter denies an access
	AccessDenied AccessDecision = iota
)

type IsLoggedInVoter

type IsLoggedInVoter struct{}

IsLoggedInVoter votes for users who have authenticated

func (*IsLoggedInVoter) Vote

func (v *IsLoggedInVoter) Vote(allAssignedPermissions []string, desiredPermission string, _ interface{}) AccessDecision

Vote for the authentication request

type PermissionVoter

type PermissionVoter struct{}

PermissionVoter votes on specific permission

func (*PermissionVoter) Vote

func (v *PermissionVoter) Vote(allAssignedPermissions []string, desiredPermission string, forObject interface{}) AccessDecision

Vote for permission

type SecurityVoter

type SecurityVoter interface {
	Vote(allAssignedPermissions []string, desiredPermission string, forObject interface{}) AccessDecision
}

SecurityVoter defines a common interface for voters who vote on security decisions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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