show some sections only to admin user
This commit is contained in:
@@ -141,10 +141,12 @@ func (rc *UserController) LoginHandler(c *gin.Context) {
|
||||
}
|
||||
|
||||
func CreateSessionData(c *gin.Context, extra any) gin.H {
|
||||
_, exists := c.Get("user")
|
||||
user, exists := c.Get("user")
|
||||
userImpl, _ := user.(models.User)
|
||||
|
||||
return gin.H{
|
||||
"loggedIn": exists,
|
||||
"isAdmin": userImpl.IsAdmin,
|
||||
"data": extra,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user