application

package
v3.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VoterStrategyAffirmative allows access if there is a positive vote
	VoterStrategyAffirmative = "affirmative"
	// VoterStrategyConsensus allows access if there are more positive votes
	VoterStrategyConsensus = "consensus"
	// VoterStrategyUnanimous allows access if there are no negative votes
	VoterStrategyUnanimous = "unanimous"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type SecurityService

type SecurityService interface {
	IsLoggedIn(context.Context, *web.Session) bool
	IsLoggedOut(context.Context, *web.Session) bool
	IsGranted(context.Context, *web.Session, string, interface{}) bool
}

SecurityService decides if a user is logged in/out, or granted a certain permission todo name arguments

type SecurityServiceImpl

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

SecurityServiceImpl default implementation of the SecurityService

func (*SecurityServiceImpl) Inject

func (s *SecurityServiceImpl) Inject(v []voter.SecurityVoter, r role.Service, cfg *struct {
	VoterStrategy     string `inject:"config:core.security.roles.voters.strategy"`
	AllowIfAllAbstain bool   `inject:"config:core.security.roles.voters.allowIfAllAbstain"`
})

Inject dependencies

func (*SecurityServiceImpl) IsGranted

func (s *SecurityServiceImpl) IsGranted(ctx context.Context, session *web.Session, desiredPermission string, object interface{}) bool

IsGranted checks for a specific permission of the user

func (*SecurityServiceImpl) IsLoggedIn

func (s *SecurityServiceImpl) IsLoggedIn(ctx context.Context, session *web.Session) bool

IsLoggedIn checks if the user is granted login permission

func (*SecurityServiceImpl) IsLoggedOut

func (s *SecurityServiceImpl) IsLoggedOut(ctx context.Context, session *web.Session) bool

IsLoggedOut checks if the user is not granted login permission

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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