1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
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.service.PermissionServiceUtil;
28  
29  import java.rmi.RemoteException;
30  
31  /**
32   * <a href="PermissionServiceSoap.java.html"><b><i>View Source</i></b></a>
33   *
34   * <p>
35   * ServiceBuilder generated this class. Modifications in this class will be
36   * overwritten the next time is generated.
37   * </p>
38   *
39   * <p>
40   * This class provides a SOAP utility for the
41   * {@link com.liferay.portal.service.PermissionServiceUtil} service utility. The
42   * static methods of this class calls the same methods of the service utility.
43   * However, the signatures are different because it is difficult for SOAP to
44   * support certain types.
45   * </p>
46   *
47   * <p>
48   * ServiceBuilder follows certain rules in translating the methods. For example,
49   * if the method in the service utility returns a {@link java.util.List}, that
50   * is translated to an array of {@link com.liferay.portal.model.PermissionSoap}.
51   * If the method in the service utility returns a
52   * {@link com.liferay.portal.model.Permission}, that is translated to a
53   * {@link com.liferay.portal.model.PermissionSoap}. Methods that SOAP cannot
54   * safely wire are skipped.
55   * </p>
56   *
57   * <p>
58   * The benefits of using the SOAP utility is that it is cross platform
59   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
60   * even Perl, to call the generated services. One drawback of SOAP is that it is
61   * slow because it needs to serialize all calls into a text format (XML).
62   * </p>
63   *
64   * <p>
65   * You can see a list of services at
66   * http://localhost:8080/tunnel-web/secure/axis. Set the property
67   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
68   * security.
69   * </p>
70   *
71   * <p>
72   * The SOAP utility is only generated for remote services.
73   * </p>
74   *
75   * @author    Brian Wing Shun Chan
76   * @see       PermissionServiceHttp
77   * @see       com.liferay.portal.model.PermissionSoap
78   * @see       com.liferay.portal.service.PermissionServiceUtil
79   * @generated
80   */
81  public class PermissionServiceSoap {
82      public static void checkPermission(long groupId, long resourceId)
83          throws RemoteException {
84          try {
85              PermissionServiceUtil.checkPermission(groupId, resourceId);
86          }
87          catch (Exception e) {
88              _log.error(e, e);
89  
90              throw new RemoteException(e.getMessage());
91          }
92      }
93  
94      public static void checkPermission(long groupId, java.lang.String name,
95          long primKey) throws RemoteException {
96          try {
97              PermissionServiceUtil.checkPermission(groupId, name, primKey);
98          }
99          catch (Exception e) {
100             _log.error(e, e);
101 
102             throw new RemoteException(e.getMessage());
103         }
104     }
105 
106     public static void checkPermission(long groupId, java.lang.String name,
107         java.lang.String primKey) throws RemoteException {
108         try {
109             PermissionServiceUtil.checkPermission(groupId, name, primKey);
110         }
111         catch (Exception e) {
112             _log.error(e, e);
113 
114             throw new RemoteException(e.getMessage());
115         }
116     }
117 
118     public static boolean hasGroupPermission(long groupId,
119         java.lang.String actionId, long resourceId) throws RemoteException {
120         try {
121             boolean returnValue = PermissionServiceUtil.hasGroupPermission(groupId,
122                     actionId, resourceId);
123 
124             return returnValue;
125         }
126         catch (Exception e) {
127             _log.error(e, e);
128 
129             throw new RemoteException(e.getMessage());
130         }
131     }
132 
133     public static boolean hasUserPermission(long userId,
134         java.lang.String actionId, long resourceId) throws RemoteException {
135         try {
136             boolean returnValue = PermissionServiceUtil.hasUserPermission(userId,
137                     actionId, resourceId);
138 
139             return returnValue;
140         }
141         catch (Exception e) {
142             _log.error(e, e);
143 
144             throw new RemoteException(e.getMessage());
145         }
146     }
147 
148     public static boolean hasUserPermissions(long userId, long groupId,
149         com.liferay.portal.model.ResourceSoap[] resources,
150         java.lang.String actionId,
151         com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
152         throws RemoteException {
153         try {
154             boolean returnValue = PermissionServiceUtil.hasUserPermissions(userId,
155                     groupId,
156                     com.liferay.portal.model.impl.ResourceModelImpl.toModels(
157                         resources), actionId, permissionCheckerBag);
158 
159             return returnValue;
160         }
161         catch (Exception e) {
162             _log.error(e, e);
163 
164             throw new RemoteException(e.getMessage());
165         }
166     }
167 
168     public static void setGroupPermissions(long groupId,
169         java.lang.String[] actionIds, long resourceId)
170         throws RemoteException {
171         try {
172             PermissionServiceUtil.setGroupPermissions(groupId, actionIds,
173                 resourceId);
174         }
175         catch (Exception e) {
176             _log.error(e, e);
177 
178             throw new RemoteException(e.getMessage());
179         }
180     }
181 
182     public static void setGroupPermissions(java.lang.String className,
183         java.lang.String classPK, long groupId, java.lang.String[] actionIds,
184         long resourceId) throws RemoteException {
185         try {
186             PermissionServiceUtil.setGroupPermissions(className, classPK,
187                 groupId, actionIds, resourceId);
188         }
189         catch (Exception e) {
190             _log.error(e, e);
191 
192             throw new RemoteException(e.getMessage());
193         }
194     }
195 
196     public static void setOrgGroupPermissions(long organizationId,
197         long groupId, java.lang.String[] actionIds, long resourceId)
198         throws RemoteException {
199         try {
200             PermissionServiceUtil.setOrgGroupPermissions(organizationId,
201                 groupId, actionIds, resourceId);
202         }
203         catch (Exception e) {
204             _log.error(e, e);
205 
206             throw new RemoteException(e.getMessage());
207         }
208     }
209 
210     public static void setRolePermission(long roleId, long groupId,
211         java.lang.String name, int scope, java.lang.String primKey,
212         java.lang.String actionId) throws RemoteException {
213         try {
214             PermissionServiceUtil.setRolePermission(roleId, groupId, name,
215                 scope, primKey, actionId);
216         }
217         catch (Exception e) {
218             _log.error(e, e);
219 
220             throw new RemoteException(e.getMessage());
221         }
222     }
223 
224     public static void setRolePermissions(long roleId, long groupId,
225         java.lang.String[] actionIds, long resourceId)
226         throws RemoteException {
227         try {
228             PermissionServiceUtil.setRolePermissions(roleId, groupId,
229                 actionIds, resourceId);
230         }
231         catch (Exception e) {
232             _log.error(e, e);
233 
234             throw new RemoteException(e.getMessage());
235         }
236     }
237 
238     public static void setUserPermissions(long userId, long groupId,
239         java.lang.String[] actionIds, long resourceId)
240         throws RemoteException {
241         try {
242             PermissionServiceUtil.setUserPermissions(userId, groupId,
243                 actionIds, resourceId);
244         }
245         catch (Exception e) {
246             _log.error(e, e);
247 
248             throw new RemoteException(e.getMessage());
249         }
250     }
251 
252     public static void unsetRolePermission(long roleId, long groupId,
253         long permissionId) throws RemoteException {
254         try {
255             PermissionServiceUtil.unsetRolePermission(roleId, groupId,
256                 permissionId);
257         }
258         catch (Exception e) {
259             _log.error(e, e);
260 
261             throw new RemoteException(e.getMessage());
262         }
263     }
264 
265     public static void unsetRolePermission(long roleId, long groupId,
266         java.lang.String name, int scope, java.lang.String primKey,
267         java.lang.String actionId) throws RemoteException {
268         try {
269             PermissionServiceUtil.unsetRolePermission(roleId, groupId, name,
270                 scope, primKey, actionId);
271         }
272         catch (Exception e) {
273             _log.error(e, e);
274 
275             throw new RemoteException(e.getMessage());
276         }
277     }
278 
279     public static void unsetRolePermissions(long roleId, long groupId,
280         java.lang.String name, int scope, java.lang.String actionId)
281         throws RemoteException {
282         try {
283             PermissionServiceUtil.unsetRolePermissions(roleId, groupId, name,
284                 scope, actionId);
285         }
286         catch (Exception e) {
287             _log.error(e, e);
288 
289             throw new RemoteException(e.getMessage());
290         }
291     }
292 
293     public static void unsetUserPermissions(long userId, long groupId,
294         java.lang.String[] actionIds, long resourceId)
295         throws RemoteException {
296         try {
297             PermissionServiceUtil.unsetUserPermissions(userId, groupId,
298                 actionIds, resourceId);
299         }
300         catch (Exception e) {
301             _log.error(e, e);
302 
303             throw new RemoteException(e.getMessage());
304         }
305     }
306 
307     private static Log _log = LogFactoryUtil.getLog(PermissionServiceSoap.class);
308 }