Documentation ¶ Index ¶ func HasRole(ctx *gin.Context, role string) bool Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func HasRole ¶ func HasRole(ctx *gin.Context, role string) bool HasRole checks if the user has the specified role in their JWT token. It retrieves the JWT claims from the context and checks if the user has the required role. If JWT authentication is not enabled or no claims are found, it returns false. Types ¶ This section is empty. Source Files ¶ View all Source files claims.go Click to show internal directories. Click to hide internal directories.