use of org.broadleafcommerce.openadmin.server.security.domain.AdminSection in project BroadleafCommerce by BroadleafCommerce.
the class AdminAbstractController method setModelAttributes.
// ************************
// GENERIC HELPER METHODS *
// ************************
/**
* Attributes to add to the model on every request
*
* @param model
* @param sectionKey
*/
protected void setModelAttributes(Model model, String sectionKey) {
AdminSection section = adminNavigationService.findAdminSectionByURI("/" + sectionKey);
if (section != null) {
model.addAttribute("sectionKey", sectionKey);
model.addAttribute(CURRENT_ADMIN_MODULE_ATTRIBUTE_NAME, section.getModule());
model.addAttribute(CURRENT_ADMIN_SECTION_ATTRIBUTE_NAME, section);
}
extensionManager.getProxy().setAdditionalModelAttributes(model, sectionKey);
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminSection 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