Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { // IsAuthenticated returns whether the context has been authenticated or not // 检查当前用户是否被授权 IsAuthenticated() bool // GetUsername returns the username of user related to the context GetUsername() string // IsSysAdmin returns whether the user is system admin IsSysAdmin() bool // IsSolutionUser returns whether the user is solution user IsSolutionUser() bool // HasReadPerm returns whether the user has read permission to the project HasReadPerm(projectIDOrName interface{}) bool // HasWritePerm returns whether the user has write permission to the project HasWritePerm(projectIDOrName interface{}) bool // HasAllPerm returns whether the user has all permissions to the project HasAllPerm(projectIDOrName interface{}) bool // Get current user's all project GetMyProjects() ([]*models.Project, error) // Get user's role in provided project GetProjectRoles(projectIDOrName interface{}) []int }
Context abstracts the operations related with authN and authZ
Click to show internal directories.
Click to hide internal directories.