I had an extension that I wrote for 6.0..5 the overrides com.liferay.portal.events.ServicePreAction. I was using this extension the deny access to the control panel for certain users. Here's the code I was using :
1
2public class SQServicePreAction extends ServicePreAction {
3
4 @Override
5 protected boolean isViewableGroup(User user, long groupId,
6 boolean privateLayout, long layoutId, String controlPanelCategory,
7 PermissionChecker permissionChecker) throws PortalException,
8 SystemException {
9
10 boolean isViewable = super.isViewableGroup(user, groupId, privateLayout, layoutId,
11 controlPanelCategory, permissionChecker);
12
13 if (isViewable) {
14 Group group = GroupLocalServiceUtil.getGroup(groupId);
15
16 if (group.isControlPanel())
17 {
18 long companyId = group.getCompanyId();
19 long userId = user.getUserId();
20
21 if (SQPortalUtils.isUserAdminUser(companyId, userId))
22 isViewable = true;
23 else
24 isViewable = !SQPortalUtils.isUserEnterpriseUser(userId);
25 }
26 }
27
28 return isViewable;
29 }
30
31}
I know that isViewableGroup is now deprecated so I've tried replacing it with something else. It doesn't to matter what I put in the class now because as soon as it deploys I get the following exception:
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
...
12:55:11,310 ERROR [http-bio-8080-exec-1][error_jsp:422] User ID null
12:55:11,311 ERROR [http-bio-8080-exec-1][error_jsp:423] Current URL /
12:55:11,311 ERROR [http-bio-8080-exec-1][error_jsp:424] Referer null
12:55:11,312 ERROR [http-bio-8080-exec-1][error_jsp:425] Remote address 127.0.0.1
12:55:11,315 ERROR [http-bio-8080-exec-1][error_jsp:427] javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NullPointerException
javax.servlet.ServletException: javax.servlet.jsp.JspException: java.lang.NullPointerException
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:907)
...
Caused by: java.lang.NullPointerException
at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:94)
at com.liferay.taglib.theme.IncludeTag.doEndTag(IncludeTag.java:39)
at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_liferay_002dtheme_005finclude_005f1(portal_jsp.java:479)
at org.apache.jsp.html.common.themes.portal_jsp._jspService(portal_jsp.java:424)
... 161 more
As soon as I remove servlet.service.events.pre=com.salesquest.portal.events.SQServicePreAction form my portal ext properties file the exception goes away. Can theis class no longer be overwritten for some Any help understanding this issue would be greatly appreciated.
Please sign in to flag this as inappropriate.