001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.PermissionServiceUtil;
023
024
054 public class PermissionServiceHttp {
055 public static void checkPermission(HttpPrincipal httpPrincipal,
056 long groupId, java.lang.String name, long primKey)
057 throws com.liferay.portal.kernel.exception.PortalException,
058 com.liferay.portal.kernel.exception.SystemException {
059 try {
060 MethodKey methodKey = new MethodKey(PermissionServiceUtil.class,
061 "checkPermission", _checkPermissionParameterTypes0);
062
063 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
064 name, primKey);
065
066 try {
067 TunnelUtil.invoke(httpPrincipal, methodHandler);
068 }
069 catch (Exception e) {
070 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071 throw (com.liferay.portal.kernel.exception.PortalException)e;
072 }
073
074 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075 throw (com.liferay.portal.kernel.exception.SystemException)e;
076 }
077
078 throw new com.liferay.portal.kernel.exception.SystemException(e);
079 }
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static void checkPermission(HttpPrincipal httpPrincipal,
089 long groupId, java.lang.String name, java.lang.String primKey)
090 throws com.liferay.portal.kernel.exception.PortalException,
091 com.liferay.portal.kernel.exception.SystemException {
092 try {
093 MethodKey methodKey = new MethodKey(PermissionServiceUtil.class,
094 "checkPermission", _checkPermissionParameterTypes1);
095
096 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
097 name, primKey);
098
099 try {
100 TunnelUtil.invoke(httpPrincipal, methodHandler);
101 }
102 catch (Exception e) {
103 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
104 throw (com.liferay.portal.kernel.exception.PortalException)e;
105 }
106
107 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
108 throw (com.liferay.portal.kernel.exception.SystemException)e;
109 }
110
111 throw new com.liferay.portal.kernel.exception.SystemException(e);
112 }
113 }
114 catch (com.liferay.portal.kernel.exception.SystemException se) {
115 _log.error(se, se);
116
117 throw se;
118 }
119 }
120
121 private static Log _log = LogFactoryUtil.getLog(PermissionServiceHttp.class);
122 private static final Class<?>[] _checkPermissionParameterTypes0 = new Class[] {
123 long.class, java.lang.String.class, long.class
124 };
125 private static final Class<?>[] _checkPermissionParameterTypes1 = new Class[] {
126 long.class, java.lang.String.class, java.lang.String.class
127 };
128 }