protected List<TabResearcherPage> findTabsWithVisibility(
HttpServletRequest request, Map<String, Object> model,
HttpServletResponse response) throws Exception
{
Integer researcherId = extractEntityId(request);
ResearcherPage researcher = null;
try
{
researcher = ((ApplicationService) applicationService).get(
ResearcherPage.class, researcherId);
}
catch (NumberFormatException e)
{
return null;
}
// check admin authorization
Boolean isAdmin = null; // anonymous access
Context context = UIUtil.obtainContext(request);
EPerson currUser = context.getCurrentUser();
if (AuthorizeManager.isAdmin(context))
{
isAdmin = true; // admin
}
else if ((currUser != null && researcher.getId() == currUser.getID()))
{
isAdmin = false; // owner
}
List<TabResearcherPage> tabs = applicationService.getTabsByVisibility(
TabResearcherPage.class, isAdmin);