Ejemplo n.º 1
0
 @Before
 static void setConnectedUser() {
   if (Security.isConnected()) {
     User user = User.find("byEmail", Security.connected()).first();
     renderArgs.put("user", user.fullname);
   }
 }
Ejemplo n.º 2
0
 @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();
     }
   }
 }
Ejemplo n.º 3
0
  @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);
    }
  }