Documentation ¶
Index ¶
- type SecurityContext
- func (s *SecurityContext) GetMyProjects() ([]*models.Project, error)
- func (s *SecurityContext) GetProjectRoles(projectIDOrName interface{}) []int
- func (s *SecurityContext) GetRolesByGroup(projectIDOrName interface{}) []int
- func (s *SecurityContext) GetUsername() string
- func (s *SecurityContext) HasAllPerm(projectIDOrName interface{}) bool
- func (s *SecurityContext) HasReadPerm(projectIDOrName interface{}) bool
- func (s *SecurityContext) HasWritePerm(projectIDOrName interface{}) bool
- 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 ¶
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(user *models.User, pm promgr.ProjectManager) *SecurityContext
NewSecurityContext ...
func (*SecurityContext) GetMyProjects ¶
func (s *SecurityContext) GetMyProjects() ([]*models.Project, error)
GetMyProjects ...
func (*SecurityContext) GetProjectRoles ¶
func (s *SecurityContext) GetProjectRoles(projectIDOrName interface{}) []int
GetProjectRoles ...
func (*SecurityContext) GetRolesByGroup ¶ added in v1.6.0
func (s *SecurityContext) GetRolesByGroup(projectIDOrName interface{}) []int
GetRolesByGroup - Get the group role of current user to the project
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) HasAllPerm ¶
func (s *SecurityContext) HasAllPerm(projectIDOrName interface{}) bool
HasAllPerm returns whether the user has all permissions to the project
func (*SecurityContext) HasReadPerm ¶
func (s *SecurityContext) HasReadPerm(projectIDOrName interface{}) bool
HasReadPerm returns whether the user has read permission to the project
func (*SecurityContext) HasWritePerm ¶
func (s *SecurityContext) HasWritePerm(projectIDOrName interface{}) bool
HasWritePerm returns whether the user has write permission to the project
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 ...
func (*SecurityContext) IsSysAdmin ¶
func (s *SecurityContext) IsSysAdmin() bool
IsSysAdmin returns whether the authenticated user is system admin It returns false if the user has not been authenticated