private PortalPage getDashboard(long id) { return portalPageManager.getPortalPageById(id); }
/** * This will always return the Dashboard using the dashboard context - this means you will (should?) never get Permission * exceptions * @return the {@link com.atlassian.jira.issue.search.SearchRequest} that represents the current dashboardId */ protected PortalPage getDashboard() { if ((dashboard == null) && (getDashboardId() != null)) { dashboard = portalPageManager.getPortalPageById(getDashboardId()); } return dashboard; }
public boolean validateForDelete(final JiraServiceContext serviceCtx, final Long portalPageId) { Assertions.notNull("serviceCtx", serviceCtx); Assertions.notNull("portalPageId", portalPageId); final ApplicationUser user = serviceCtx.getLoggedInApplicationUser(); final ErrorCollection errorCollection = serviceCtx.getErrorCollection(); if (user == null) { errorCollection.addErrorMessage(serviceCtx.getI18nBean().getText("admin.errors.portalpages.owned.anonymous.user")); } else { final PortalPage page = portalPageManager.getPortalPageById(portalPageId); if (page == null) { errorCollection.addErrorMessage(serviceCtx.getI18nBean().getText("admin.errors.portalpages.nonexistent")); } else if (page.isSystemDefaultPortalPage()) { errorCollection.addErrorMessage(serviceCtx.getI18nBean().getText("admin.errors.portalpages.not.delete.system.default")); } else if (!user.equals(page.getOwner())) { errorCollection.addErrorMessage(serviceCtx.getI18nBean().getText("admin.errors.portalpages.must.be.owner")); } } return !errorCollection.hasAnyErrors(); }
final PortalPage readPage = portalPageManager.getPortalPageById(portalPage.getId()); if (readPage == null)