use of org.broadleafcommerce.openadmin.server.security.domain.AdminModule in project BroadleafCommerce by BroadleafCommerce.
the class AdminNavigationDaoImpl method save.
@Override
public AdminSection save(AdminSection adminSection) {
adminSection = em.merge(adminSection);
AdminModule module = adminSection.getModule();
em.refresh(module);
return adminSection;
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminModule in project BroadleafCommerce by BroadleafCommerce.
the class AdminNavigationDaoImpl method readAllAdminModules.
@Override
public List<AdminModule> readAllAdminModules() {
Query query = em.createNamedQuery("BC_READ_ALL_ADMIN_MODULES");
query.setHint(QueryHints.HINT_CACHEABLE, true);
query.setHint(QueryHints.HINT_CACHE_REGION, "blAdminSecurityQuery");
List<AdminModule> modules = query.getResultList();
return modules;
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminModule 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.AdminModule 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);
}
use of org.broadleafcommerce.openadmin.server.security.domain.AdminModule in project BroadleafCommerce by BroadleafCommerce.
the class AdminNavigationDaoImpl method remove.
@Override
public void remove(AdminSection adminSection) {
AdminModule module = adminSection.getModule();
em.remove(adminSection);
em.refresh(module);
}
Aggregations