@Before static void setConnectedUser() { if (Security.isConnected()) { User user = User.find("byEmail", Security.connected()).first(); renderArgs.put("user", user.fullname); } }
@Before static void setConnectedUser() { if (Security.isConnected()) { User user = User.find("byUsername", Security.connected()).first(); if (!user.isAdmin) { flash.error(Messages.get("UserIsNotAuthorized")); Application.index(); } } }
@Before static void setConnectedUser() { if (Security.isConnected()) { User user = User.find("byEmail", Security.connected()).first(); if (user == null) { user = new User("*****@*****.**", "1234", "Andreas"); user.save(); } renderArgs.put("user", user.fullname); } }