Package org.ngrinder.model

Examples of org.ngrinder.model.Role


  @RequestMapping(value = {"/home", "/"})
  public String home(User user, @RequestParam(value = "exception", defaultValue = "") String exception,
             @RequestParam(value = "region", defaultValue = "") String region, ModelMap model,
             HttpServletResponse response, HttpServletRequest request) {
    try {
      Role role;
      try {
        recordReferrer(region);
        // set local language
        setLanguage(getCurrentUser().getUserLanguage(), response, request);
        setLoginPageDate(model);
        role = user.getRole();
      } catch (AuthenticationCredentialsNotFoundException e) {
        return "login";
      }
      setPanelEntries(model);
      model.addAttribute("handlers", scriptHandlerFactory.getVisibleHandlers());

      if (StringUtils.isNotBlank(exception)) {
        model.addAttribute("exception", exception);
      }
      if (role == Role.ADMIN || role == Role.SUPER_USER || role == Role.USER) {
        return "index";
      } else {
        LOG.info("Invalid user role:{}", role.getFullName());
        return "login";
      }
    } catch (Exception e) {
      // Make the home reliable...
      model.addAttribute("exception", e.getMessage());
View Full Code Here

TOP

Related Classes of org.ngrinder.model.Role

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.