use of com.helger.photon.core.menu.filter.MenuObjectFilterUserHasRole in project peppol-practical by phax.
the class MenuSecure method init.
public static void init(@Nonnull final IMenuTree aMenuTree) {
// We need this additional indirection layer, as the pages are initialized
// statically!
final MenuObjectFilterUserAssignedToUserGroup aFilterAdministrators = new MenuObjectFilterUserAssignedToUserGroup(CPPApp.USERGROUP_ADMINISTRATORS_ID);
final MenuObjectFilterUserHasRole aFilterPeppolSenders = new MenuObjectFilterUserHasRole(CPPApp.ROLE_PEPPOL_SENDERS_ID);
// CRM
{
final IMenuItemPage aCRM = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_CRM, "CRM", aMenuTree)).setDisplayFilter(aFilterAdministrators);
aMenuTree.createItem(aCRM, new PageSecureCRMGroup(CMenuSecure.MENU_CRM_GROUPS)).setDisplayFilter(aFilterAdministrators);
aMenuTree.createItem(aCRM, new PageSecureCRMSubscriber(CMenuSecure.MENU_CRM_SUBSCRIBERS)).setDisplayFilter(aFilterAdministrators);
}
// Peppol
{
final IMenuItemPage aPeppol = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_PEPPOL, "Peppol", aMenuTree));
aMenuTree.createItem(aPeppol, new PageSecurePeppolSendAS4(CMenuSecure.MENU_PEPPOL_SEND_AS4)).setDisplayFilter(aFilterPeppolSenders);
}
// Comments
{
aMenuTree.createRootItem(new PageSecureCommentAdmin(CMenuSecure.MENU_COMMENTS)).setDisplayFilter(aFilterAdministrators);
}
// Schematron tools
{
aMenuTree.createRootItem(new PageSecureSchematronTools(CMenuSecure.MENU_SCH_TOOLS)).setDisplayFilter(aFilterAdministrators);
}
// Administrator
{
final IMenuItemPage aAdmin = aMenuTree.createRootItem(new BasePageShowChildren<WebPageExecutionContext>(CMenuSecure.MENU_ADMIN, "Administration", aMenuTree));
// Must be accessible for all Config users
aMenuTree.createItem(aAdmin, new BasePageSecurityChangePassword<WebPageExecutionContext>(CMenuSecure.MENU_ADMIN_CHANGE_PASSWORD));
// Admins only
aMenuTree.createItem(aAdmin, new PageSecureAdminAddons(CMenuSecure.MENU_ADMIN_ADDONS)).setDisplayFilter(aFilterAdministrators);
aMenuTree.createItem(aAdmin, new PageSecureSMLConfiguration(CMenuSecure.MENU_SML_CONFIGURATION)).setDisplayFilter(aFilterAdministrators);
BootstrapPagesMenuConfigurator.addAllItems(aMenuTree, aAdmin, aFilterAdministrators, CPPApp.DEFAULT_LOCALE);
}
// Default menu item
aMenuTree.setDefaultMenuItemID(CMenuSecure.MENU_COMMENTS);
}
Aggregations