use of com.emc.metalnx.modelattribute.preferences.UserPreferences in project metalnx-web by irods-contrib.
the class PreferencesController method index.
@RequestMapping(value = "/")
public String index(final Model model, final HttpServletRequest request) {
logger.info("index()");
DataGridUser loggedUser = loggedUserUtils.getLoggedDataGridUser();
String locale = loggedUser.getLocale();
String uiMode = (String) request.getSession().getAttribute("uiMode");
if (uiMode == null || uiMode.isEmpty()) {
if (loggedUser.isAdmin()) {
uiMode = UI_ADMIN_MODE;
} else {
uiMode = UI_USER_MODE;
}
}
UserPreferences userPreferences = new UserPreferences();
userPreferences.setLocaleLanguage(locale);
userPreferences.setForceFileOverwriting(loggedUser.isForceFileOverwriting());
userPreferences.setAdvancedView(loggedUser.isAdvancedView());
model.addAttribute("preferences", userPreferences);
model.addAttribute("uiMode", uiMode);
model.addAttribute("topnavHeader", headerService.getheader("prefrences"));
return "preferences/index";
}
Aggregations