use of org.broadleafcommerce.openadmin.server.security.domain.AdminMenu in project BroadleafCommerce by BroadleafCommerce.
the class AdminNavigationServiceImpl method buildMenu.
@Override
public AdminMenu buildMenu(AdminUser adminUser) {
AdminMenu adminMenu = new AdminMenu();
List<AdminModule> modules = adminNavigationDao.readAllAdminModules();
populateAdminMenu(adminUser, adminMenu, modules);
return adminMenu;
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminMenu in project BroadleafCommerce by BroadleafCommerce.
the class AdminModuleProcessor method populateModelVariables.
@Override
public Map<String, Object> populateModelVariables(String tagName, Map<String, String> tagAttributes, BroadleafTemplateContext context) {
String resultVar = tagAttributes.get("resultVar");
Map<String, Object> newModelVars = new HashMap<>();
AdminUser user = getPersistentAdminUser();
if (user != null) {
AdminMenu menu = adminNavigationService.buildMenu(user);
newModelVars.put(resultVar, menu);
}
return newModelVars;
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminMenu in project BroadleafCommerce by BroadleafCommerce.
the class AdminLoginController method loginSuccess.
@RequestMapping(value = { "/", "/loginSuccess" }, method = RequestMethod.GET)
public String loginSuccess(HttpServletRequest request, HttpServletResponse response, Model model) {
AdminMenu adminMenu = adminNavigationService.buildMenu(getPersistentAdminUser());
if (!adminMenu.getAdminModules().isEmpty()) {
AdminModule first = adminMenu.getAdminModules().get(0);
List<AdminSection> sections = first.getSections();
if (!sections.isEmpty()) {
AdminSection adminSection = sections.get(0);
return "redirect:" + adminSection.getUrl();
}
}
return "noAccess";
}
Aggregations