Search in sources :

Example 6 with AdminModule

use of org.broadleafcommerce.openadmin.server.security.domain.AdminModule 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";
}
Also used : AdminMenu(org.broadleafcommerce.openadmin.server.security.domain.AdminMenu) AdminModule(org.broadleafcommerce.openadmin.server.security.domain.AdminModule) AdminSection(org.broadleafcommerce.openadmin.server.security.domain.AdminSection) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

AdminModule (org.broadleafcommerce.openadmin.server.security.domain.AdminModule)6 AdminMenu (org.broadleafcommerce.openadmin.server.security.domain.AdminMenu)2 AdminSection (org.broadleafcommerce.openadmin.server.security.domain.AdminSection)2 Query (javax.persistence.Query)1 TypedQuery (javax.persistence.TypedQuery)1 BeanComparator (org.apache.commons.beanutils.BeanComparator)1 AdminModuleDTO (org.broadleafcommerce.openadmin.server.security.domain.AdminModuleDTO)1 AdminModuleImpl (org.broadleafcommerce.openadmin.server.security.domain.AdminModuleImpl)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1