Exemplo n.º 1
0
 @Check("login")
 public static void index() {
   User curUser = User.find("byName", Secure.Security.connected()).first();
   if (curUser.type == UserType.ADMINISTRATOR) {
     redirect("/admin/crud");
   } else if (curUser.type == UserType.STUDENT) {
     Student.index();
   } else {
     Teacher.index();
   }
 }
Exemplo n.º 2
0
 public RoleHolder getRoleHolder() {
   String userName = Secure.Security.connected();
   return User.getByUserName(userName);
 }