Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UserCtxKey = contextKey("user")
Functions ¶
func WebsocketInitFunc ¶
func WebsocketInitFunc(bun *bun.DB) transport.WebsocketInitFunc
Types ¶
type UserContext ¶
func ForContext ¶
func ForContext(ctx context.Context) *UserContext
ForContext finds the user from the context. REQUIRES Middleware to have run.
func GetUser ¶
func GetUser(ctx context.Context) (*UserContext, error)
GetUser Helper function to get the current user from the context.
func (UserContext) HasPermissionAdmin ¶
func (c UserContext) HasPermissionAdmin() bool
Click to show internal directories.
Click to hide internal directories.