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.service.PermissionServiceUtil;
20  
21  import java.rmi.RemoteException;
22  
23  /**
24   * <a href="PermissionServiceSoap.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides a SOAP utility for the
33   * {@link com.liferay.portal.service.PermissionServiceUtil} service utility. The
34   * static methods of this class calls the same methods of the service utility.
35   * However, the signatures are different because it is difficult for SOAP to
36   * support certain types.
37   * </p>
38   *
39   * <p>
40   * ServiceBuilder follows certain rules in translating the methods. For example,
41   * if the method in the service utility returns a {@link java.util.List}, that
42   * is translated to an array of {@link com.liferay.portal.model.PermissionSoap}.
43   * If the method in the service utility returns a
44   * {@link com.liferay.portal.model.Permission}, that is translated to a
45   * {@link com.liferay.portal.model.PermissionSoap}. Methods that SOAP cannot
46   * safely wire are skipped.
47   * </p>
48   *
49   * <p>
50   * The benefits of using the SOAP utility is that it is cross platform
51   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
52   * even Perl, to call the generated services. One drawback of SOAP is that it is
53   * slow because it needs to serialize all calls into a text format (XML).
54   * </p>
55   *
56   * <p>
57   * You can see a list of services at
58   * http://localhost:8080/tunnel-web/secure/axis. Set the property
59   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
60   * security.
61   * </p>
62   *
63   * <p>
64   * The SOAP utility is only generated for remote services.
65   * </p>
66   *
67   * @author    Brian Wing Shun Chan
68   * @see       PermissionServiceHttp
69   * @see       com.liferay.portal.model.PermissionSoap
70   * @see       com.liferay.portal.service.PermissionServiceUtil
71   * @generated
72   */
73  public class PermissionServiceSoap {
74      public static void checkPermission(long groupId, long resourceId)
75          throws RemoteException {
76          try {
77              PermissionServiceUtil.checkPermission(groupId, resourceId);
78          }
79          catch (Exception e) {
80              _log.error(e, e);
81  
82              throw new RemoteException(e.getMessage());
83          }
84      }
85  
86      public static void checkPermission(long groupId, java.lang.String name,
87          long primKey) throws RemoteException {
88          try {
89              PermissionServiceUtil.checkPermission(groupId, name, primKey);
90          }
91          catch (Exception e) {
92              _log.error(e, e);
93  
94              throw new RemoteException(e.getMessage());
95          }
96      }
97  
98      public static void checkPermission(long groupId, java.lang.String name,
99          java.lang.String primKey) throws RemoteException {
100         try {
101             PermissionServiceUtil.checkPermission(groupId, name, primKey);
102         }
103         catch (Exception e) {
104             _log.error(e, e);
105 
106             throw new RemoteException(e.getMessage());
107         }
108     }
109 
110     public static boolean hasGroupPermission(long groupId,
111         java.lang.String actionId, long resourceId) throws RemoteException {
112         try {
113             boolean returnValue = PermissionServiceUtil.hasGroupPermission(groupId,
114                     actionId, resourceId);
115 
116             return returnValue;
117         }
118         catch (Exception e) {
119             _log.error(e, e);
120 
121             throw new RemoteException(e.getMessage());
122         }
123     }
124 
125     public static boolean hasUserPermission(long userId,
126         java.lang.String actionId, long resourceId) throws RemoteException {
127         try {
128             boolean returnValue = PermissionServiceUtil.hasUserPermission(userId,
129                     actionId, resourceId);
130 
131             return returnValue;
132         }
133         catch (Exception e) {
134             _log.error(e, e);
135 
136             throw new RemoteException(e.getMessage());
137         }
138     }
139 
140     public static boolean hasUserPermissions(long userId, long groupId,
141         com.liferay.portal.model.ResourceSoap[] resources,
142         java.lang.String actionId,
143         com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
144         throws RemoteException {
145         try {
146             boolean returnValue = PermissionServiceUtil.hasUserPermissions(userId,
147                     groupId,
148                     com.liferay.portal.model.impl.ResourceModelImpl.toModels(
149                         resources), actionId, permissionCheckerBag);
150 
151             return returnValue;
152         }
153         catch (Exception e) {
154             _log.error(e, e);
155 
156             throw new RemoteException(e.getMessage());
157         }
158     }
159 
160     public static void setGroupPermissions(long groupId,
161         java.lang.String[] actionIds, long resourceId)
162         throws RemoteException {
163         try {
164             PermissionServiceUtil.setGroupPermissions(groupId, actionIds,
165                 resourceId);
166         }
167         catch (Exception e) {
168             _log.error(e, e);
169 
170             throw new RemoteException(e.getMessage());
171         }
172     }
173 
174     public static void setGroupPermissions(java.lang.String className,
175         java.lang.String classPK, long groupId, java.lang.String[] actionIds,
176         long resourceId) throws RemoteException {
177         try {
178             PermissionServiceUtil.setGroupPermissions(className, classPK,
179                 groupId, actionIds, resourceId);
180         }
181         catch (Exception e) {
182             _log.error(e, e);
183 
184             throw new RemoteException(e.getMessage());
185         }
186     }
187 
188     public static void setOrgGroupPermissions(long organizationId,
189         long groupId, java.lang.String[] actionIds, long resourceId)
190         throws RemoteException {
191         try {
192             PermissionServiceUtil.setOrgGroupPermissions(organizationId,
193                 groupId, actionIds, resourceId);
194         }
195         catch (Exception e) {
196             _log.error(e, e);
197 
198             throw new RemoteException(e.getMessage());
199         }
200     }
201 
202     public static void setRolePermission(long roleId, long groupId,
203         java.lang.String name, int scope, java.lang.String primKey,
204         java.lang.String actionId) throws RemoteException {
205         try {
206             PermissionServiceUtil.setRolePermission(roleId, groupId, name,
207                 scope, primKey, actionId);
208         }
209         catch (Exception e) {
210             _log.error(e, e);
211 
212             throw new RemoteException(e.getMessage());
213         }
214     }
215 
216     public static void setRolePermissions(long roleId, long groupId,
217         java.lang.String[] actionIds, long resourceId)
218         throws RemoteException {
219         try {
220             PermissionServiceUtil.setRolePermissions(roleId, groupId,
221                 actionIds, resourceId);
222         }
223         catch (Exception e) {
224             _log.error(e, e);
225 
226             throw new RemoteException(e.getMessage());
227         }
228     }
229 
230     public static void setUserPermissions(long userId, long groupId,
231         java.lang.String[] actionIds, long resourceId)
232         throws RemoteException {
233         try {
234             PermissionServiceUtil.setUserPermissions(userId, groupId,
235                 actionIds, resourceId);
236         }
237         catch (Exception e) {
238             _log.error(e, e);
239 
240             throw new RemoteException(e.getMessage());
241         }
242     }
243 
244     public static void unsetRolePermission(long roleId, long groupId,
245         long permissionId) throws RemoteException {
246         try {
247             PermissionServiceUtil.unsetRolePermission(roleId, groupId,
248                 permissionId);
249         }
250         catch (Exception e) {
251             _log.error(e, e);
252 
253             throw new RemoteException(e.getMessage());
254         }
255     }
256 
257     public static void unsetRolePermission(long roleId, long groupId,
258         java.lang.String name, int scope, java.lang.String primKey,
259         java.lang.String actionId) throws RemoteException {
260         try {
261             PermissionServiceUtil.unsetRolePermission(roleId, groupId, name,
262                 scope, primKey, actionId);
263         }
264         catch (Exception e) {
265             _log.error(e, e);
266 
267             throw new RemoteException(e.getMessage());
268         }
269     }
270 
271     public static void unsetRolePermissions(long roleId, long groupId,
272         java.lang.String name, int scope, java.lang.String actionId)
273         throws RemoteException {
274         try {
275             PermissionServiceUtil.unsetRolePermissions(roleId, groupId, name,
276                 scope, actionId);
277         }
278         catch (Exception e) {
279             _log.error(e, e);
280 
281             throw new RemoteException(e.getMessage());
282         }
283     }
284 
285     public static void unsetUserPermissions(long userId, long groupId,
286         java.lang.String[] actionIds, long resourceId)
287         throws RemoteException {
288         try {
289             PermissionServiceUtil.unsetUserPermissions(userId, groupId,
290                 actionIds, resourceId);
291         }
292         catch (Exception e) {
293             _log.error(e, e);
294 
295             throw new RemoteException(e.getMessage());
296         }
297     }
298 
299     private static Log _log = LogFactoryUtil.getLog(PermissionServiceSoap.class);
300 }