use of org.apache.wicket.request.mapper.parameter.PageParameters in project oc-explorer by devgateway.
the class BasePage method newAccountMenu.
protected NavbarButton<EditUserPage> newAccountMenu() {
PageParameters pageParametersForAccountPage = new PageParameters();
Person person = SecurityUtil.getCurrentAuthenticatedPerson();
// account menu
Model<String> account = null;
if (person != null) {
account = Model.of(person.getFirstName());
pageParametersForAccountPage.add(WebConstants.PARAM_ID, person.getId());
}
NavbarButton<EditUserPage> accountMenu = new NavbarButton<>(EditUserPage.class, pageParametersForAccountPage, account);
accountMenu.setIconType(GlyphIconType.user);
MetaDataRoleAuthorizationStrategy.authorize(accountMenu, Component.RENDER, SecurityConstants.Roles.ROLE_USER);
return accountMenu;
}
Aggregations