voter

package
v3.0.0-alpha3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AccessAbstained = iota
	AccessGranted
	AccessDenied
)

todo: add custom type

Variables

This section is empty.

Functions

This section is empty.

Types

type IsLoggedInVoter

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

IsLoggedInVoter votes for users who have authenticated

func (*IsLoggedInVoter) Inject

func (v *IsLoggedInVoter) Inject(rs role.Service)

Inject roleService dependency

func (*IsLoggedInVoter) Vote

func (v *IsLoggedInVoter) Vote(ctx context.Context, session *web.Session, permission string, _ interface{}) int

Vote for the authentication request

type RoleVoter

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

RoleVoter votes on specific roles

func (*RoleVoter) Inject

func (v *RoleVoter) Inject(rs role.Service)

Inject dependencies

func (*RoleVoter) Vote

func (v *RoleVoter) Vote(ctx context.Context, session *web.Session, permission string, object interface{}) int

Vote for roles

type SecurityVoter

type SecurityVoter interface {
	Vote(context.Context, *web.Session, string, interface{}) int
}

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