1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.IntegerWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.ResourcePermissionServiceUtil;
33
34
71 public class ResourcePermissionServiceHttp {
72 public static void addResourcePermission(HttpPrincipal httpPrincipal,
73 long groupId, long companyId, java.lang.String name, int scope,
74 java.lang.String primKey, long roleId, java.lang.String actionId)
75 throws com.liferay.portal.PortalException,
76 com.liferay.portal.SystemException {
77 try {
78 Object paramObj0 = new LongWrapper(groupId);
79
80 Object paramObj1 = new LongWrapper(companyId);
81
82 Object paramObj2 = name;
83
84 if (name == null) {
85 paramObj2 = new NullWrapper("java.lang.String");
86 }
87
88 Object paramObj3 = new IntegerWrapper(scope);
89
90 Object paramObj4 = primKey;
91
92 if (primKey == null) {
93 paramObj4 = new NullWrapper("java.lang.String");
94 }
95
96 Object paramObj5 = new LongWrapper(roleId);
97
98 Object paramObj6 = actionId;
99
100 if (actionId == null) {
101 paramObj6 = new NullWrapper("java.lang.String");
102 }
103
104 MethodWrapper methodWrapper = new MethodWrapper(ResourcePermissionServiceUtil.class.getName(),
105 "addResourcePermission",
106 new Object[] {
107 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
108 paramObj5, paramObj6
109 });
110
111 try {
112 TunnelUtil.invoke(httpPrincipal, methodWrapper);
113 }
114 catch (Exception e) {
115 if (e instanceof com.liferay.portal.PortalException) {
116 throw (com.liferay.portal.PortalException)e;
117 }
118
119 if (e instanceof com.liferay.portal.SystemException) {
120 throw (com.liferay.portal.SystemException)e;
121 }
122
123 throw new com.liferay.portal.SystemException(e);
124 }
125 }
126 catch (com.liferay.portal.SystemException se) {
127 _log.error(se, se);
128
129 throw se;
130 }
131 }
132
133 public static void setIndividualResourcePermissions(
134 HttpPrincipal httpPrincipal, long groupId, long companyId,
135 java.lang.String name, java.lang.String primKey, long roleId,
136 java.lang.String[] actionIds)
137 throws com.liferay.portal.PortalException,
138 com.liferay.portal.SystemException {
139 try {
140 Object paramObj0 = new LongWrapper(groupId);
141
142 Object paramObj1 = new LongWrapper(companyId);
143
144 Object paramObj2 = name;
145
146 if (name == null) {
147 paramObj2 = new NullWrapper("java.lang.String");
148 }
149
150 Object paramObj3 = primKey;
151
152 if (primKey == null) {
153 paramObj3 = new NullWrapper("java.lang.String");
154 }
155
156 Object paramObj4 = new LongWrapper(roleId);
157
158 Object paramObj5 = actionIds;
159
160 if (actionIds == null) {
161 paramObj5 = new NullWrapper("[Ljava.lang.String;");
162 }
163
164 MethodWrapper methodWrapper = new MethodWrapper(ResourcePermissionServiceUtil.class.getName(),
165 "setIndividualResourcePermissions",
166 new Object[] {
167 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
168 paramObj5
169 });
170
171 try {
172 TunnelUtil.invoke(httpPrincipal, methodWrapper);
173 }
174 catch (Exception e) {
175 if (e instanceof com.liferay.portal.PortalException) {
176 throw (com.liferay.portal.PortalException)e;
177 }
178
179 if (e instanceof com.liferay.portal.SystemException) {
180 throw (com.liferay.portal.SystemException)e;
181 }
182
183 throw new com.liferay.portal.SystemException(e);
184 }
185 }
186 catch (com.liferay.portal.SystemException se) {
187 _log.error(se, se);
188
189 throw se;
190 }
191 }
192
193 public static void removeResourcePermission(HttpPrincipal httpPrincipal,
194 long groupId, long companyId, java.lang.String name, int scope,
195 java.lang.String primKey, long roleId, java.lang.String actionId)
196 throws com.liferay.portal.PortalException,
197 com.liferay.portal.SystemException {
198 try {
199 Object paramObj0 = new LongWrapper(groupId);
200
201 Object paramObj1 = new LongWrapper(companyId);
202
203 Object paramObj2 = name;
204
205 if (name == null) {
206 paramObj2 = new NullWrapper("java.lang.String");
207 }
208
209 Object paramObj3 = new IntegerWrapper(scope);
210
211 Object paramObj4 = primKey;
212
213 if (primKey == null) {
214 paramObj4 = new NullWrapper("java.lang.String");
215 }
216
217 Object paramObj5 = new LongWrapper(roleId);
218
219 Object paramObj6 = actionId;
220
221 if (actionId == null) {
222 paramObj6 = new NullWrapper("java.lang.String");
223 }
224
225 MethodWrapper methodWrapper = new MethodWrapper(ResourcePermissionServiceUtil.class.getName(),
226 "removeResourcePermission",
227 new Object[] {
228 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
229 paramObj5, paramObj6
230 });
231
232 try {
233 TunnelUtil.invoke(httpPrincipal, methodWrapper);
234 }
235 catch (Exception e) {
236 if (e instanceof com.liferay.portal.PortalException) {
237 throw (com.liferay.portal.PortalException)e;
238 }
239
240 if (e instanceof com.liferay.portal.SystemException) {
241 throw (com.liferay.portal.SystemException)e;
242 }
243
244 throw new com.liferay.portal.SystemException(e);
245 }
246 }
247 catch (com.liferay.portal.SystemException se) {
248 _log.error(se, se);
249
250 throw se;
251 }
252 }
253
254 public static void removeResourcePermissions(HttpPrincipal httpPrincipal,
255 long groupId, long companyId, java.lang.String name, int scope,
256 long roleId, java.lang.String actionId)
257 throws com.liferay.portal.PortalException,
258 com.liferay.portal.SystemException {
259 try {
260 Object paramObj0 = new LongWrapper(groupId);
261
262 Object paramObj1 = new LongWrapper(companyId);
263
264 Object paramObj2 = name;
265
266 if (name == null) {
267 paramObj2 = new NullWrapper("java.lang.String");
268 }
269
270 Object paramObj3 = new IntegerWrapper(scope);
271
272 Object paramObj4 = new LongWrapper(roleId);
273
274 Object paramObj5 = actionId;
275
276 if (actionId == null) {
277 paramObj5 = new NullWrapper("java.lang.String");
278 }
279
280 MethodWrapper methodWrapper = new MethodWrapper(ResourcePermissionServiceUtil.class.getName(),
281 "removeResourcePermissions",
282 new Object[] {
283 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
284 paramObj5
285 });
286
287 try {
288 TunnelUtil.invoke(httpPrincipal, methodWrapper);
289 }
290 catch (Exception e) {
291 if (e instanceof com.liferay.portal.PortalException) {
292 throw (com.liferay.portal.PortalException)e;
293 }
294
295 if (e instanceof com.liferay.portal.SystemException) {
296 throw (com.liferay.portal.SystemException)e;
297 }
298
299 throw new com.liferay.portal.SystemException(e);
300 }
301 }
302 catch (com.liferay.portal.SystemException se) {
303 _log.error(se, se);
304
305 throw se;
306 }
307 }
308
309 private static Log _log = LogFactoryUtil.getLog(ResourcePermissionServiceHttp.class);
310 }