Search in sources :

Example 1 with AdminModuleImpl

use of org.broadleafcommerce.openadmin.server.security.domain.AdminModuleImpl in project BroadleafCommerce by BroadleafCommerce.

the class AdminNavigationServiceImpl method populateAdminMenu.

protected void populateAdminMenu(AdminUser adminUser, AdminMenu adminMenu, List<AdminModule> modules) {
    for (AdminModule module : modules) {
        List<AdminSection> authorizedSections = buildAuthorizedSectionsList(adminUser, module);
        if (authorizedSections != null && authorizedSections.size() > 0) {
            AdminModuleDTO adminModuleDto = ((AdminModuleImpl) module).getAdminModuleDTO();
            adminMenu.getAdminModules().add(adminModuleDto);
            adminModuleDto.setSections(authorizedSections);
        }
    }
    // Sort the authorized modules
    BeanComparator displayComparator = new BeanComparator("displayOrder");
    Collections.sort(adminMenu.getAdminModules(), displayComparator);
}
Also used : AdminModule(org.broadleafcommerce.openadmin.server.security.domain.AdminModule) AdminSection(org.broadleafcommerce.openadmin.server.security.domain.AdminSection) AdminModuleDTO(org.broadleafcommerce.openadmin.server.security.domain.AdminModuleDTO) AdminModuleImpl(org.broadleafcommerce.openadmin.server.security.domain.AdminModuleImpl) BeanComparator(org.apache.commons.beanutils.BeanComparator)

Aggregations

BeanComparator (org.apache.commons.beanutils.BeanComparator)1 AdminModule (org.broadleafcommerce.openadmin.server.security.domain.AdminModule)1 AdminModuleDTO (org.broadleafcommerce.openadmin.server.security.domain.AdminModuleDTO)1 AdminModuleImpl (org.broadleafcommerce.openadmin.server.security.domain.AdminModuleImpl)1 AdminSection (org.broadleafcommerce.openadmin.server.security.domain.AdminSection)1