GetLoginUserIDFromContext get user id from context
(ctx *gin.Context)
| 268 | |
| 269 | // GetLoginUserIDFromContext get user id from context |
| 270 | func GetLoginUserIDFromContext(ctx *gin.Context) (userID string) { |
| 271 | userInfo := GetUserInfoFromContext(ctx) |
| 272 | if userInfo == nil { |
| 273 | return "" |
| 274 | } |
| 275 | return userInfo.UserID |
| 276 | } |
| 277 | |
| 278 | // GetIsAdminFromContext get user is admin from context |
| 279 | func GetIsAdminFromContext(ctx *gin.Context) (isAdmin bool) { |
no test coverage detected