func checkUser(c *revel.Controller) revel.Result { if _, ok := c.Session["user"]; ok { return nil } c.Flash.Error(c.Message("login.message.notloggedin")) return c.Redirect(routes.App.Login()) }
func adminOnly(c *revel.Controller) revel.Result { if c.Session["usertype"] == "ADMIN" { return nil } c.Flash.Error(c.Message("access.message.notallowed")) return c.Redirect(routes.App.Index()) }