robot

package
v0.0.0-...-b7d4bf0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SecurityContext

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

SecurityContext implements security.Context interface based on database

func NewSecurityContext

func NewSecurityContext(r *robot.Robot) *SecurityContext

NewSecurityContext ...

func (*SecurityContext) Can

func (s *SecurityContext) Can(ctx context.Context, action types.Action, resource types.Resource) bool

Can returns whether the robot can do action on resource

func (*SecurityContext) GetUsername

func (s *SecurityContext) GetUsername() string

GetUsername returns the username of the authenticated user It returns null if the user has not been authenticated

func (*SecurityContext) IsAuthenticated

func (s *SecurityContext) IsAuthenticated() bool

IsAuthenticated returns true if the user has been authenticated

func (*SecurityContext) IsSolutionUser

func (s *SecurityContext) IsSolutionUser() bool

IsSolutionUser robot cannot be a system admin

func (*SecurityContext) IsSysAdmin

func (s *SecurityContext) IsSysAdmin() bool

IsSysAdmin robot cannot be a system admin

func (*SecurityContext) Name

func (s *SecurityContext) Name() string

Name returns the name of the security context

func (*SecurityContext) User

func (s *SecurityContext) User() *robot.Robot

User get the current user

Jump to

Keyboard shortcuts

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