1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.IntegerWrapper;
20  import com.liferay.portal.kernel.util.LongWrapper;
21  import com.liferay.portal.kernel.util.MethodWrapper;
22  import com.liferay.portal.kernel.util.NullWrapper;
23  import com.liferay.portal.security.auth.HttpPrincipal;
24  import com.liferay.portal.service.PermissionServiceUtil;
25  
26  /**
27   * <a href="PermissionServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portal.service.PermissionServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       PermissionServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portal.service.PermissionServiceUtil
61   * @generated
62   */
63  public class PermissionServiceHttp {
64      public static void checkPermission(HttpPrincipal httpPrincipal,
65          long groupId, long resourceId)
66          throws com.liferay.portal.kernel.exception.PortalException,
67              com.liferay.portal.kernel.exception.SystemException {
68          try {
69              Object paramObj0 = new LongWrapper(groupId);
70  
71              Object paramObj1 = new LongWrapper(resourceId);
72  
73              MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
74                      "checkPermission", new Object[] { paramObj0, paramObj1 });
75  
76              try {
77                  TunnelUtil.invoke(httpPrincipal, methodWrapper);
78              }
79              catch (Exception e) {
80                  if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
81                      throw (com.liferay.portal.kernel.exception.PortalException)e;
82                  }
83  
84                  if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
85                      throw (com.liferay.portal.kernel.exception.SystemException)e;
86                  }
87  
88                  throw new com.liferay.portal.kernel.exception.SystemException(e);
89              }
90          }
91          catch (com.liferay.portal.kernel.exception.SystemException se) {
92              _log.error(se, se);
93  
94              throw se;
95          }
96      }
97  
98      public static void checkPermission(HttpPrincipal httpPrincipal,
99          long groupId, java.lang.String name, long primKey)
100         throws com.liferay.portal.kernel.exception.PortalException,
101             com.liferay.portal.kernel.exception.SystemException {
102         try {
103             Object paramObj0 = new LongWrapper(groupId);
104 
105             Object paramObj1 = name;
106 
107             if (name == null) {
108                 paramObj1 = new NullWrapper("java.lang.String");
109             }
110 
111             Object paramObj2 = new LongWrapper(primKey);
112 
113             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
114                     "checkPermission",
115                     new Object[] { paramObj0, paramObj1, paramObj2 });
116 
117             try {
118                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
119             }
120             catch (Exception e) {
121                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
122                     throw (com.liferay.portal.kernel.exception.PortalException)e;
123                 }
124 
125                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
126                     throw (com.liferay.portal.kernel.exception.SystemException)e;
127                 }
128 
129                 throw new com.liferay.portal.kernel.exception.SystemException(e);
130             }
131         }
132         catch (com.liferay.portal.kernel.exception.SystemException se) {
133             _log.error(se, se);
134 
135             throw se;
136         }
137     }
138 
139     public static void checkPermission(HttpPrincipal httpPrincipal,
140         long groupId, java.lang.String name, java.lang.String primKey)
141         throws com.liferay.portal.kernel.exception.PortalException,
142             com.liferay.portal.kernel.exception.SystemException {
143         try {
144             Object paramObj0 = new LongWrapper(groupId);
145 
146             Object paramObj1 = name;
147 
148             if (name == null) {
149                 paramObj1 = new NullWrapper("java.lang.String");
150             }
151 
152             Object paramObj2 = primKey;
153 
154             if (primKey == null) {
155                 paramObj2 = new NullWrapper("java.lang.String");
156             }
157 
158             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
159                     "checkPermission",
160                     new Object[] { paramObj0, paramObj1, paramObj2 });
161 
162             try {
163                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
164             }
165             catch (Exception e) {
166                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
167                     throw (com.liferay.portal.kernel.exception.PortalException)e;
168                 }
169 
170                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
171                     throw (com.liferay.portal.kernel.exception.SystemException)e;
172                 }
173 
174                 throw new com.liferay.portal.kernel.exception.SystemException(e);
175             }
176         }
177         catch (com.liferay.portal.kernel.exception.SystemException se) {
178             _log.error(se, se);
179 
180             throw se;
181         }
182     }
183 
184     public static boolean hasGroupPermission(HttpPrincipal httpPrincipal,
185         long groupId, java.lang.String actionId, long resourceId)
186         throws com.liferay.portal.kernel.exception.SystemException {
187         try {
188             Object paramObj0 = new LongWrapper(groupId);
189 
190             Object paramObj1 = actionId;
191 
192             if (actionId == null) {
193                 paramObj1 = new NullWrapper("java.lang.String");
194             }
195 
196             Object paramObj2 = new LongWrapper(resourceId);
197 
198             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
199                     "hasGroupPermission",
200                     new Object[] { paramObj0, paramObj1, paramObj2 });
201 
202             Object returnObj = null;
203 
204             try {
205                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
206             }
207             catch (Exception e) {
208                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
209                     throw (com.liferay.portal.kernel.exception.SystemException)e;
210                 }
211 
212                 throw new com.liferay.portal.kernel.exception.SystemException(e);
213             }
214 
215             return ((Boolean)returnObj).booleanValue();
216         }
217         catch (com.liferay.portal.kernel.exception.SystemException se) {
218             _log.error(se, se);
219 
220             throw se;
221         }
222     }
223 
224     public static boolean hasUserPermission(HttpPrincipal httpPrincipal,
225         long userId, java.lang.String actionId, long resourceId)
226         throws com.liferay.portal.kernel.exception.SystemException {
227         try {
228             Object paramObj0 = new LongWrapper(userId);
229 
230             Object paramObj1 = actionId;
231 
232             if (actionId == null) {
233                 paramObj1 = new NullWrapper("java.lang.String");
234             }
235 
236             Object paramObj2 = new LongWrapper(resourceId);
237 
238             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
239                     "hasUserPermission",
240                     new Object[] { paramObj0, paramObj1, paramObj2 });
241 
242             Object returnObj = null;
243 
244             try {
245                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
246             }
247             catch (Exception e) {
248                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
249                     throw (com.liferay.portal.kernel.exception.SystemException)e;
250                 }
251 
252                 throw new com.liferay.portal.kernel.exception.SystemException(e);
253             }
254 
255             return ((Boolean)returnObj).booleanValue();
256         }
257         catch (com.liferay.portal.kernel.exception.SystemException se) {
258             _log.error(se, se);
259 
260             throw se;
261         }
262     }
263 
264     public static boolean hasUserPermissions(HttpPrincipal httpPrincipal,
265         long userId, long groupId,
266         java.util.List<com.liferay.portal.model.Resource> resources,
267         java.lang.String actionId,
268         com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
269         throws com.liferay.portal.kernel.exception.PortalException,
270             com.liferay.portal.kernel.exception.SystemException {
271         try {
272             Object paramObj0 = new LongWrapper(userId);
273 
274             Object paramObj1 = new LongWrapper(groupId);
275 
276             Object paramObj2 = resources;
277 
278             if (resources == null) {
279                 paramObj2 = new NullWrapper("java.util.List");
280             }
281 
282             Object paramObj3 = actionId;
283 
284             if (actionId == null) {
285                 paramObj3 = new NullWrapper("java.lang.String");
286             }
287 
288             Object paramObj4 = permissionCheckerBag;
289 
290             if (permissionCheckerBag == null) {
291                 paramObj4 = new NullWrapper(
292                         "com.liferay.portal.security.permission.PermissionCheckerBag");
293             }
294 
295             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
296                     "hasUserPermissions",
297                     new Object[] {
298                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
299                     });
300 
301             Object returnObj = null;
302 
303             try {
304                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
305             }
306             catch (Exception e) {
307                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
308                     throw (com.liferay.portal.kernel.exception.PortalException)e;
309                 }
310 
311                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
312                     throw (com.liferay.portal.kernel.exception.SystemException)e;
313                 }
314 
315                 throw new com.liferay.portal.kernel.exception.SystemException(e);
316             }
317 
318             return ((Boolean)returnObj).booleanValue();
319         }
320         catch (com.liferay.portal.kernel.exception.SystemException se) {
321             _log.error(se, se);
322 
323             throw se;
324         }
325     }
326 
327     public static void setGroupPermissions(HttpPrincipal httpPrincipal,
328         long groupId, java.lang.String[] actionIds, long resourceId)
329         throws com.liferay.portal.kernel.exception.PortalException,
330             com.liferay.portal.kernel.exception.SystemException {
331         try {
332             Object paramObj0 = new LongWrapper(groupId);
333 
334             Object paramObj1 = actionIds;
335 
336             if (actionIds == null) {
337                 paramObj1 = new NullWrapper("[Ljava.lang.String;");
338             }
339 
340             Object paramObj2 = new LongWrapper(resourceId);
341 
342             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
343                     "setGroupPermissions",
344                     new Object[] { paramObj0, paramObj1, paramObj2 });
345 
346             try {
347                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
348             }
349             catch (Exception e) {
350                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
351                     throw (com.liferay.portal.kernel.exception.PortalException)e;
352                 }
353 
354                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
355                     throw (com.liferay.portal.kernel.exception.SystemException)e;
356                 }
357 
358                 throw new com.liferay.portal.kernel.exception.SystemException(e);
359             }
360         }
361         catch (com.liferay.portal.kernel.exception.SystemException se) {
362             _log.error(se, se);
363 
364             throw se;
365         }
366     }
367 
368     public static void setGroupPermissions(HttpPrincipal httpPrincipal,
369         java.lang.String className, java.lang.String classPK, long groupId,
370         java.lang.String[] actionIds, long resourceId)
371         throws com.liferay.portal.kernel.exception.PortalException,
372             com.liferay.portal.kernel.exception.SystemException {
373         try {
374             Object paramObj0 = className;
375 
376             if (className == null) {
377                 paramObj0 = new NullWrapper("java.lang.String");
378             }
379 
380             Object paramObj1 = classPK;
381 
382             if (classPK == null) {
383                 paramObj1 = new NullWrapper("java.lang.String");
384             }
385 
386             Object paramObj2 = new LongWrapper(groupId);
387 
388             Object paramObj3 = actionIds;
389 
390             if (actionIds == null) {
391                 paramObj3 = new NullWrapper("[Ljava.lang.String;");
392             }
393 
394             Object paramObj4 = new LongWrapper(resourceId);
395 
396             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
397                     "setGroupPermissions",
398                     new Object[] {
399                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
400                     });
401 
402             try {
403                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
404             }
405             catch (Exception e) {
406                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
407                     throw (com.liferay.portal.kernel.exception.PortalException)e;
408                 }
409 
410                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
411                     throw (com.liferay.portal.kernel.exception.SystemException)e;
412                 }
413 
414                 throw new com.liferay.portal.kernel.exception.SystemException(e);
415             }
416         }
417         catch (com.liferay.portal.kernel.exception.SystemException se) {
418             _log.error(se, se);
419 
420             throw se;
421         }
422     }
423 
424     public static void setOrgGroupPermissions(HttpPrincipal httpPrincipal,
425         long organizationId, long groupId, java.lang.String[] actionIds,
426         long resourceId)
427         throws com.liferay.portal.kernel.exception.PortalException,
428             com.liferay.portal.kernel.exception.SystemException {
429         try {
430             Object paramObj0 = new LongWrapper(organizationId);
431 
432             Object paramObj1 = new LongWrapper(groupId);
433 
434             Object paramObj2 = actionIds;
435 
436             if (actionIds == null) {
437                 paramObj2 = new NullWrapper("[Ljava.lang.String;");
438             }
439 
440             Object paramObj3 = new LongWrapper(resourceId);
441 
442             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
443                     "setOrgGroupPermissions",
444                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
445 
446             try {
447                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
448             }
449             catch (Exception e) {
450                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
451                     throw (com.liferay.portal.kernel.exception.PortalException)e;
452                 }
453 
454                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
455                     throw (com.liferay.portal.kernel.exception.SystemException)e;
456                 }
457 
458                 throw new com.liferay.portal.kernel.exception.SystemException(e);
459             }
460         }
461         catch (com.liferay.portal.kernel.exception.SystemException se) {
462             _log.error(se, se);
463 
464             throw se;
465         }
466     }
467 
468     public static void setRolePermission(HttpPrincipal httpPrincipal,
469         long roleId, long groupId, java.lang.String name, int scope,
470         java.lang.String primKey, java.lang.String actionId)
471         throws com.liferay.portal.kernel.exception.PortalException,
472             com.liferay.portal.kernel.exception.SystemException {
473         try {
474             Object paramObj0 = new LongWrapper(roleId);
475 
476             Object paramObj1 = new LongWrapper(groupId);
477 
478             Object paramObj2 = name;
479 
480             if (name == null) {
481                 paramObj2 = new NullWrapper("java.lang.String");
482             }
483 
484             Object paramObj3 = new IntegerWrapper(scope);
485 
486             Object paramObj4 = primKey;
487 
488             if (primKey == null) {
489                 paramObj4 = new NullWrapper("java.lang.String");
490             }
491 
492             Object paramObj5 = actionId;
493 
494             if (actionId == null) {
495                 paramObj5 = new NullWrapper("java.lang.String");
496             }
497 
498             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
499                     "setRolePermission",
500                     new Object[] {
501                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
502                         paramObj5
503                     });
504 
505             try {
506                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
507             }
508             catch (Exception e) {
509                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
510                     throw (com.liferay.portal.kernel.exception.PortalException)e;
511                 }
512 
513                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
514                     throw (com.liferay.portal.kernel.exception.SystemException)e;
515                 }
516 
517                 throw new com.liferay.portal.kernel.exception.SystemException(e);
518             }
519         }
520         catch (com.liferay.portal.kernel.exception.SystemException se) {
521             _log.error(se, se);
522 
523             throw se;
524         }
525     }
526 
527     public static void setRolePermissions(HttpPrincipal httpPrincipal,
528         long roleId, long groupId, java.lang.String[] actionIds, long resourceId)
529         throws com.liferay.portal.kernel.exception.PortalException,
530             com.liferay.portal.kernel.exception.SystemException {
531         try {
532             Object paramObj0 = new LongWrapper(roleId);
533 
534             Object paramObj1 = new LongWrapper(groupId);
535 
536             Object paramObj2 = actionIds;
537 
538             if (actionIds == null) {
539                 paramObj2 = new NullWrapper("[Ljava.lang.String;");
540             }
541 
542             Object paramObj3 = new LongWrapper(resourceId);
543 
544             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
545                     "setRolePermissions",
546                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
547 
548             try {
549                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
550             }
551             catch (Exception e) {
552                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
553                     throw (com.liferay.portal.kernel.exception.PortalException)e;
554                 }
555 
556                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
557                     throw (com.liferay.portal.kernel.exception.SystemException)e;
558                 }
559 
560                 throw new com.liferay.portal.kernel.exception.SystemException(e);
561             }
562         }
563         catch (com.liferay.portal.kernel.exception.SystemException se) {
564             _log.error(se, se);
565 
566             throw se;
567         }
568     }
569 
570     public static void setUserPermissions(HttpPrincipal httpPrincipal,
571         long userId, long groupId, java.lang.String[] actionIds, long resourceId)
572         throws com.liferay.portal.kernel.exception.PortalException,
573             com.liferay.portal.kernel.exception.SystemException {
574         try {
575             Object paramObj0 = new LongWrapper(userId);
576 
577             Object paramObj1 = new LongWrapper(groupId);
578 
579             Object paramObj2 = actionIds;
580 
581             if (actionIds == null) {
582                 paramObj2 = new NullWrapper("[Ljava.lang.String;");
583             }
584 
585             Object paramObj3 = new LongWrapper(resourceId);
586 
587             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
588                     "setUserPermissions",
589                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
590 
591             try {
592                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
593             }
594             catch (Exception e) {
595                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
596                     throw (com.liferay.portal.kernel.exception.PortalException)e;
597                 }
598 
599                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
600                     throw (com.liferay.portal.kernel.exception.SystemException)e;
601                 }
602 
603                 throw new com.liferay.portal.kernel.exception.SystemException(e);
604             }
605         }
606         catch (com.liferay.portal.kernel.exception.SystemException se) {
607             _log.error(se, se);
608 
609             throw se;
610         }
611     }
612 
613     public static void unsetRolePermission(HttpPrincipal httpPrincipal,
614         long roleId, long groupId, long permissionId)
615         throws com.liferay.portal.kernel.exception.PortalException,
616             com.liferay.portal.kernel.exception.SystemException {
617         try {
618             Object paramObj0 = new LongWrapper(roleId);
619 
620             Object paramObj1 = new LongWrapper(groupId);
621 
622             Object paramObj2 = new LongWrapper(permissionId);
623 
624             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
625                     "unsetRolePermission",
626                     new Object[] { paramObj0, paramObj1, paramObj2 });
627 
628             try {
629                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
630             }
631             catch (Exception e) {
632                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
633                     throw (com.liferay.portal.kernel.exception.PortalException)e;
634                 }
635 
636                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
637                     throw (com.liferay.portal.kernel.exception.SystemException)e;
638                 }
639 
640                 throw new com.liferay.portal.kernel.exception.SystemException(e);
641             }
642         }
643         catch (com.liferay.portal.kernel.exception.SystemException se) {
644             _log.error(se, se);
645 
646             throw se;
647         }
648     }
649 
650     public static void unsetRolePermission(HttpPrincipal httpPrincipal,
651         long roleId, long groupId, java.lang.String name, int scope,
652         java.lang.String primKey, java.lang.String actionId)
653         throws com.liferay.portal.kernel.exception.PortalException,
654             com.liferay.portal.kernel.exception.SystemException {
655         try {
656             Object paramObj0 = new LongWrapper(roleId);
657 
658             Object paramObj1 = new LongWrapper(groupId);
659 
660             Object paramObj2 = name;
661 
662             if (name == null) {
663                 paramObj2 = new NullWrapper("java.lang.String");
664             }
665 
666             Object paramObj3 = new IntegerWrapper(scope);
667 
668             Object paramObj4 = primKey;
669 
670             if (primKey == null) {
671                 paramObj4 = new NullWrapper("java.lang.String");
672             }
673 
674             Object paramObj5 = actionId;
675 
676             if (actionId == null) {
677                 paramObj5 = new NullWrapper("java.lang.String");
678             }
679 
680             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
681                     "unsetRolePermission",
682                     new Object[] {
683                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
684                         paramObj5
685                     });
686 
687             try {
688                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
689             }
690             catch (Exception e) {
691                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
692                     throw (com.liferay.portal.kernel.exception.PortalException)e;
693                 }
694 
695                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
696                     throw (com.liferay.portal.kernel.exception.SystemException)e;
697                 }
698 
699                 throw new com.liferay.portal.kernel.exception.SystemException(e);
700             }
701         }
702         catch (com.liferay.portal.kernel.exception.SystemException se) {
703             _log.error(se, se);
704 
705             throw se;
706         }
707     }
708 
709     public static void unsetRolePermissions(HttpPrincipal httpPrincipal,
710         long roleId, long groupId, java.lang.String name, int scope,
711         java.lang.String actionId)
712         throws com.liferay.portal.kernel.exception.PortalException,
713             com.liferay.portal.kernel.exception.SystemException {
714         try {
715             Object paramObj0 = new LongWrapper(roleId);
716 
717             Object paramObj1 = new LongWrapper(groupId);
718 
719             Object paramObj2 = name;
720 
721             if (name == null) {
722                 paramObj2 = new NullWrapper("java.lang.String");
723             }
724 
725             Object paramObj3 = new IntegerWrapper(scope);
726 
727             Object paramObj4 = actionId;
728 
729             if (actionId == null) {
730                 paramObj4 = new NullWrapper("java.lang.String");
731             }
732 
733             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
734                     "unsetRolePermissions",
735                     new Object[] {
736                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
737                     });
738 
739             try {
740                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
741             }
742             catch (Exception e) {
743                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
744                     throw (com.liferay.portal.kernel.exception.PortalException)e;
745                 }
746 
747                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
748                     throw (com.liferay.portal.kernel.exception.SystemException)e;
749                 }
750 
751                 throw new com.liferay.portal.kernel.exception.SystemException(e);
752             }
753         }
754         catch (com.liferay.portal.kernel.exception.SystemException se) {
755             _log.error(se, se);
756 
757             throw se;
758         }
759     }
760 
761     public static void unsetUserPermissions(HttpPrincipal httpPrincipal,
762         long userId, long groupId, java.lang.String[] actionIds, long resourceId)
763         throws com.liferay.portal.kernel.exception.PortalException,
764             com.liferay.portal.kernel.exception.SystemException {
765         try {
766             Object paramObj0 = new LongWrapper(userId);
767 
768             Object paramObj1 = new LongWrapper(groupId);
769 
770             Object paramObj2 = actionIds;
771 
772             if (actionIds == null) {
773                 paramObj2 = new NullWrapper("[Ljava.lang.String;");
774             }
775 
776             Object paramObj3 = new LongWrapper(resourceId);
777 
778             MethodWrapper methodWrapper = new MethodWrapper(PermissionServiceUtil.class.getName(),
779                     "unsetUserPermissions",
780                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
781 
782             try {
783                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
784             }
785             catch (Exception e) {
786                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
787                     throw (com.liferay.portal.kernel.exception.PortalException)e;
788                 }
789 
790                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
791                     throw (com.liferay.portal.kernel.exception.SystemException)e;
792                 }
793 
794                 throw new com.liferay.portal.kernel.exception.SystemException(e);
795             }
796         }
797         catch (com.liferay.portal.kernel.exception.SystemException se) {
798             _log.error(se, se);
799 
800             throw se;
801         }
802     }
803 
804     private static Log _log = LogFactoryUtil.getLog(PermissionServiceHttp.class);
805 }