func CheckLoginAdmin(c *revel.Controller) revel.Result { if c.Session[LOGIN_USERID] == "" || models.Role(c.Session[LOGIN_USERROLE]) != models.ROLE_SUPER_ADMIN { return c.Redirect( revel.MainRouter.Reverse("Auth.Login", map[string]string{}).Url, ) } return nil }
func (c *Super) SessionGetUser() (user models.User) { user = models.User{ UserId: c.Session[LOGIN_USERID], Username: c.Session[LOGIN_USERNAME], Role: models.Role(c.Session[LOGIN_USERROLE]), } return user }