public String getPermissionsUrl() {
if (permissionsUrl == null) {
LiferayFacesContext liferayFacesContext = LiferayFacesContext.getInstance();
ExternalContext externalContext = liferayFacesContext.getExternalContext();
long scopeGroupId = liferayFacesContext.getScopeGroupId();
// Get the underlying HttpServletRequest and HttpServletResponse
PortletRequest portletRequest = (PortletRequest) externalContext.getRequest();
HttpServletRequest httpServletRequest = PortalUtil.getHttpServletRequest(portletRequest);
PortletResponse portletResponse = (PortletResponse) externalContext.getResponse();
HttpServletResponse httpServletResponse = PortalUtil.getHttpServletResponse(portletResponse);
ELContext elContext = liferayFacesContext.getELContext();
StringJspWriter stringJspWriter = new StringJspWriter();
PageContextAdapter pageContextAdapter = new PageContextAdapter(httpServletRequest, httpServletResponse,
elContext, stringJspWriter);
// Invoke the Liferay Tag class directly (rather than using the tag from a JSP).