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.ResourcePermissionServiceUtil;
023
024
054 public class ResourcePermissionServiceHttp {
055 public static void addResourcePermission(HttpPrincipal httpPrincipal,
056 long groupId, long companyId, java.lang.String name, int scope,
057 java.lang.String primKey, long roleId, java.lang.String actionId)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
062 "addResourcePermission",
063 _addResourcePermissionParameterTypes0);
064
065 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
066 companyId, name, scope, primKey, roleId, actionId);
067
068 try {
069 TunnelUtil.invoke(httpPrincipal, methodHandler);
070 }
071 catch (Exception e) {
072 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
073 throw (com.liferay.portal.kernel.exception.PortalException)e;
074 }
075
076 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
077 throw (com.liferay.portal.kernel.exception.SystemException)e;
078 }
079
080 throw new com.liferay.portal.kernel.exception.SystemException(e);
081 }
082 }
083 catch (com.liferay.portal.kernel.exception.SystemException se) {
084 _log.error(se, se);
085
086 throw se;
087 }
088 }
089
090 public static void setIndividualResourcePermissions(
091 HttpPrincipal httpPrincipal, long groupId, long companyId,
092 java.lang.String name, java.lang.String primKey, long roleId,
093 java.lang.String[] actionIds)
094 throws com.liferay.portal.kernel.exception.PortalException,
095 com.liferay.portal.kernel.exception.SystemException {
096 try {
097 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
098 "setIndividualResourcePermissions",
099 _setIndividualResourcePermissionsParameterTypes1);
100
101 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
102 companyId, name, primKey, roleId, actionIds);
103
104 try {
105 TunnelUtil.invoke(httpPrincipal, methodHandler);
106 }
107 catch (Exception e) {
108 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
109 throw (com.liferay.portal.kernel.exception.PortalException)e;
110 }
111
112 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
113 throw (com.liferay.portal.kernel.exception.SystemException)e;
114 }
115
116 throw new com.liferay.portal.kernel.exception.SystemException(e);
117 }
118 }
119 catch (com.liferay.portal.kernel.exception.SystemException se) {
120 _log.error(se, se);
121
122 throw se;
123 }
124 }
125
126 public static void removeResourcePermission(HttpPrincipal httpPrincipal,
127 long groupId, long companyId, java.lang.String name, int scope,
128 java.lang.String primKey, long roleId, java.lang.String actionId)
129 throws com.liferay.portal.kernel.exception.PortalException,
130 com.liferay.portal.kernel.exception.SystemException {
131 try {
132 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
133 "removeResourcePermission",
134 _removeResourcePermissionParameterTypes2);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
137 companyId, name, scope, primKey, roleId, actionId);
138
139 try {
140 TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153 }
154 catch (com.liferay.portal.kernel.exception.SystemException se) {
155 _log.error(se, se);
156
157 throw se;
158 }
159 }
160
161 public static void removeResourcePermissions(HttpPrincipal httpPrincipal,
162 long groupId, long companyId, java.lang.String name, int scope,
163 long roleId, java.lang.String actionId)
164 throws com.liferay.portal.kernel.exception.PortalException,
165 com.liferay.portal.kernel.exception.SystemException {
166 try {
167 MethodKey methodKey = new MethodKey(ResourcePermissionServiceUtil.class.getName(),
168 "removeResourcePermissions",
169 _removeResourcePermissionsParameterTypes3);
170
171 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
172 companyId, name, scope, roleId, actionId);
173
174 try {
175 TunnelUtil.invoke(httpPrincipal, methodHandler);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
179 throw (com.liferay.portal.kernel.exception.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
183 throw (com.liferay.portal.kernel.exception.SystemException)e;
184 }
185
186 throw new com.liferay.portal.kernel.exception.SystemException(e);
187 }
188 }
189 catch (com.liferay.portal.kernel.exception.SystemException se) {
190 _log.error(se, se);
191
192 throw se;
193 }
194 }
195
196 private static Log _log = LogFactoryUtil.getLog(ResourcePermissionServiceHttp.class);
197 private static final Class<?>[] _addResourcePermissionParameterTypes0 = new Class[] {
198 long.class, long.class, java.lang.String.class, int.class,
199 java.lang.String.class, long.class, java.lang.String.class
200 };
201 private static final Class<?>[] _setIndividualResourcePermissionsParameterTypes1 =
202 new Class[] {
203 long.class, long.class, java.lang.String.class,
204 java.lang.String.class, long.class, java.lang.String[].class
205 };
206 private static final Class<?>[] _removeResourcePermissionParameterTypes2 = new Class[] {
207 long.class, long.class, java.lang.String.class, int.class,
208 java.lang.String.class, long.class, java.lang.String.class
209 };
210 private static final Class<?>[] _removeResourcePermissionsParameterTypes3 = new Class[] {
211 long.class, long.class, java.lang.String.class, int.class,
212 long.class, java.lang.String.class
213 };
214 }