Documentation ¶
Index ¶
- Constants
- type SecurityService
- type SecurityServiceImpl
- func (s *SecurityServiceImpl) Inject(v []voter.SecurityVoter, r role.Service, cfg ...)
- func (s *SecurityServiceImpl) IsGranted(ctx context.Context, session *web.Session, desiredPermission string, ...) bool
- func (s *SecurityServiceImpl) IsLoggedIn(ctx context.Context, session *web.Session) bool
- func (s *SecurityServiceImpl) IsLoggedOut(ctx context.Context, session *web.Session) bool
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:security.roles.voters.strategy"` AllowIfAllAbstain bool `inject:"config: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 ¶
IsLoggedIn checks if the user is granted login permission
func (*SecurityServiceImpl) IsLoggedOut ¶
IsLoggedOut checks if the user is not granted login permission
Click to show internal directories.
Click to hide internal directories.