Documentation ¶
Index ¶
- func NewRobot(username string, namespace rbac.Namespace, policy []*rbac.Policy) rbac.User
- type SecurityContext
- func (s *SecurityContext) Can(action rbac.Action, resource rbac.Resource) bool
- func (s *SecurityContext) GetMyProjects() ([]*models.Project, error)
- func (s *SecurityContext) GetProjectRoles(projectIDOrName interface{}) []int
- func (s *SecurityContext) GetUsername() string
- func (s *SecurityContext) IsAuthenticated() bool
- func (s *SecurityContext) IsSolutionUser() bool
- func (s *SecurityContext) IsSysAdmin() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SecurityContext ¶
type SecurityContext struct {
// contains filtered or unexported fields
}
SecurityContext implements security.Context interface based on database
func NewSecurityContext ¶
func NewSecurityContext(robot *models.Robot, pm promgr.ProjectManager, policy []*rbac.Policy) *SecurityContext
NewSecurityContext ...
func (*SecurityContext) GetMyProjects ¶
func (s *SecurityContext) GetMyProjects() ([]*models.Project, error)
GetMyProjects no implementation
func (*SecurityContext) GetProjectRoles ¶
func (s *SecurityContext) GetProjectRoles(projectIDOrName interface{}) []int
GetProjectRoles no implementation
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
Click to show internal directories.
Click to hide internal directories.