1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="PermissionLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link PermissionLocalService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       PermissionLocalService
37   * @generated
38   */
39  public class PermissionLocalServiceUtil {
40      public static com.liferay.portal.model.Permission addPermission(
41          com.liferay.portal.model.Permission permission)
42          throws com.liferay.portal.SystemException {
43          return getService().addPermission(permission);
44      }
45  
46      public static com.liferay.portal.model.Permission createPermission(
47          long permissionId) {
48          return getService().createPermission(permissionId);
49      }
50  
51      public static void deletePermission(long permissionId)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          getService().deletePermission(permissionId);
55      }
56  
57      public static void deletePermission(
58          com.liferay.portal.model.Permission permission)
59          throws com.liferay.portal.SystemException {
60          getService().deletePermission(permission);
61      }
62  
63      public static java.util.List<Object> dynamicQuery(
64          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
65          throws com.liferay.portal.SystemException {
66          return getService().dynamicQuery(dynamicQuery);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
71          int end) throws com.liferay.portal.SystemException {
72          return getService().dynamicQuery(dynamicQuery, start, end);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end,
78          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
79          throws com.liferay.portal.SystemException {
80          return getService()
81                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
82      }
83  
84      public static int dynamicQueryCount(
85          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
86          throws com.liferay.portal.SystemException {
87          return getService().dynamicQueryCount(dynamicQuery);
88      }
89  
90      public static com.liferay.portal.model.Permission getPermission(
91          long permissionId)
92          throws com.liferay.portal.PortalException,
93              com.liferay.portal.SystemException {
94          return getService().getPermission(permissionId);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
98          int start, int end) throws com.liferay.portal.SystemException {
99          return getService().getPermissions(start, end);
100     }
101 
102     public static int getPermissionsCount()
103         throws com.liferay.portal.SystemException {
104         return getService().getPermissionsCount();
105     }
106 
107     public static com.liferay.portal.model.Permission updatePermission(
108         com.liferay.portal.model.Permission permission)
109         throws com.liferay.portal.SystemException {
110         return getService().updatePermission(permission);
111     }
112 
113     public static com.liferay.portal.model.Permission updatePermission(
114         com.liferay.portal.model.Permission permission, boolean merge)
115         throws com.liferay.portal.SystemException {
116         return getService().updatePermission(permission, merge);
117     }
118 
119     public static com.liferay.portal.model.Permission addPermission(
120         long companyId, java.lang.String actionId, long resourceId)
121         throws com.liferay.portal.SystemException {
122         return getService().addPermission(companyId, actionId, resourceId);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Permission> addPermissions(
126         long companyId, java.lang.String name, long resourceId,
127         boolean portletActions) throws com.liferay.portal.SystemException {
128         return getService()
129                    .addPermissions(companyId, name, resourceId, portletActions);
130     }
131 
132     public static java.util.List<com.liferay.portal.model.Permission> addPermissions(
133         long companyId, java.util.List<String> actionIds, long resourceId)
134         throws com.liferay.portal.SystemException {
135         return getService().addPermissions(companyId, actionIds, resourceId);
136     }
137 
138     public static void addUserPermissions(long userId,
139         java.lang.String[] actionIds, long resourceId)
140         throws com.liferay.portal.PortalException,
141             com.liferay.portal.SystemException {
142         getService().addUserPermissions(userId, actionIds, resourceId);
143     }
144 
145     public static java.util.List<String> getActions(
146         java.util.List<com.liferay.portal.model.Permission> permissions) {
147         return getService().getActions(permissions);
148     }
149 
150     public static java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
151         long groupId, long resourceId)
152         throws com.liferay.portal.SystemException {
153         return getService().getGroupPermissions(groupId, resourceId);
154     }
155 
156     public static java.util.List<com.liferay.portal.model.Permission> getGroupPermissions(
157         long groupId, long companyId, java.lang.String name, int scope,
158         java.lang.String primKey) throws com.liferay.portal.SystemException {
159         return getService()
160                    .getGroupPermissions(groupId, companyId, name, scope, primKey);
161     }
162 
163     public static java.util.List<com.liferay.portal.model.Permission> getOrgGroupPermissions(
164         long organizationId, long groupId, long resourceId)
165         throws com.liferay.portal.SystemException {
166         return getService()
167                    .getOrgGroupPermissions(organizationId, groupId, resourceId);
168     }
169 
170     public static long getLatestPermissionId()
171         throws com.liferay.portal.SystemException {
172         return getService().getLatestPermissionId();
173     }
174 
175     public static java.util.List<com.liferay.portal.model.Permission> getPermissions(
176         long companyId, java.lang.String[] actionIds, long resourceId)
177         throws com.liferay.portal.SystemException {
178         return getService().getPermissions(companyId, actionIds, resourceId);
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
182         long roleId) throws com.liferay.portal.SystemException {
183         return getService().getRolePermissions(roleId);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.Permission> getRolePermissions(
187         long roleId, long resourceId) throws com.liferay.portal.SystemException {
188         return getService().getRolePermissions(roleId, resourceId);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
192         long userId, long resourceId) throws com.liferay.portal.SystemException {
193         return getService().getUserPermissions(userId, resourceId);
194     }
195 
196     public static java.util.List<com.liferay.portal.model.Permission> getUserPermissions(
197         long userId, long companyId, java.lang.String name, int scope,
198         java.lang.String primKey) throws com.liferay.portal.SystemException {
199         return getService()
200                    .getUserPermissions(userId, companyId, name, scope, primKey);
201     }
202 
203     public static boolean hasGroupPermission(long groupId,
204         java.lang.String actionId, long resourceId)
205         throws com.liferay.portal.SystemException {
206         return getService().hasGroupPermission(groupId, actionId, resourceId);
207     }
208 
209     public static boolean hasRolePermission(long roleId, long companyId,
210         java.lang.String name, int scope, java.lang.String actionId)
211         throws com.liferay.portal.SystemException {
212         return getService()
213                    .hasRolePermission(roleId, companyId, name, scope, actionId);
214     }
215 
216     public static boolean hasRolePermission(long roleId, long companyId,
217         java.lang.String name, int scope, java.lang.String primKey,
218         java.lang.String actionId) throws com.liferay.portal.SystemException {
219         return getService()
220                    .hasRolePermission(roleId, companyId, name, scope, primKey,
221             actionId);
222     }
223 
224     public static boolean hasUserPermission(long userId,
225         java.lang.String actionId, long resourceId)
226         throws com.liferay.portal.SystemException {
227         return getService().hasUserPermission(userId, actionId, resourceId);
228     }
229 
230     public static boolean hasUserPermissions(long userId, long groupId,
231         java.util.List<com.liferay.portal.model.Resource> resources,
232         java.lang.String actionId,
233         com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         return getService()
237                    .hasUserPermissions(userId, groupId, resources, actionId,
238             permissionCheckerBag);
239     }
240 
241     public static void setGroupPermissions(long groupId,
242         java.lang.String[] actionIds, long resourceId)
243         throws com.liferay.portal.PortalException,
244             com.liferay.portal.SystemException {
245         getService().setGroupPermissions(groupId, actionIds, resourceId);
246     }
247 
248     public static void setGroupPermissions(java.lang.String className,
249         java.lang.String classPK, long groupId, java.lang.String[] actionIds,
250         long resourceId)
251         throws com.liferay.portal.PortalException,
252             com.liferay.portal.SystemException {
253         getService()
254             .setGroupPermissions(className, classPK, groupId, actionIds,
255             resourceId);
256     }
257 
258     public static void setOrgGroupPermissions(long organizationId,
259         long groupId, java.lang.String[] actionIds, long resourceId)
260         throws com.liferay.portal.PortalException,
261             com.liferay.portal.SystemException {
262         getService()
263             .setOrgGroupPermissions(organizationId, groupId, actionIds,
264             resourceId);
265     }
266 
267     public static void setRolePermission(long roleId, long companyId,
268         java.lang.String name, int scope, java.lang.String primKey,
269         java.lang.String actionId)
270         throws com.liferay.portal.PortalException,
271             com.liferay.portal.SystemException {
272         getService()
273             .setRolePermission(roleId, companyId, name, scope, primKey, actionId);
274     }
275 
276     public static void setRolePermissions(long roleId, long companyId,
277         java.lang.String name, int scope, java.lang.String primKey,
278         java.lang.String[] actionIds)
279         throws com.liferay.portal.PortalException,
280             com.liferay.portal.SystemException {
281         getService()
282             .setRolePermissions(roleId, companyId, name, scope, primKey,
283             actionIds);
284     }
285 
286     public static void setRolePermissions(long roleId,
287         java.lang.String[] actionIds, long resourceId)
288         throws com.liferay.portal.PortalException,
289             com.liferay.portal.SystemException {
290         getService().setRolePermissions(roleId, actionIds, resourceId);
291     }
292 
293     public static void setUserPermissions(long userId,
294         java.lang.String[] actionIds, long resourceId)
295         throws com.liferay.portal.PortalException,
296             com.liferay.portal.SystemException {
297         getService().setUserPermissions(userId, actionIds, resourceId);
298     }
299 
300     public static void unsetRolePermission(long roleId, long permissionId)
301         throws com.liferay.portal.SystemException {
302         getService().unsetRolePermission(roleId, permissionId);
303     }
304 
305     public static void unsetRolePermission(long roleId, long companyId,
306         java.lang.String name, int scope, java.lang.String primKey,
307         java.lang.String actionId) throws com.liferay.portal.SystemException {
308         getService()
309             .unsetRolePermission(roleId, companyId, name, scope, primKey,
310             actionId);
311     }
312 
313     public static void unsetRolePermissions(long roleId, long companyId,
314         java.lang.String name, int scope, java.lang.String actionId)
315         throws com.liferay.portal.SystemException {
316         getService()
317             .unsetRolePermissions(roleId, companyId, name, scope, actionId);
318     }
319 
320     public static void unsetUserPermissions(long userId,
321         java.lang.String[] actionIds, long resourceId)
322         throws com.liferay.portal.SystemException {
323         getService().unsetUserPermissions(userId, actionIds, resourceId);
324     }
325 
326     public static PermissionLocalService getService() {
327         if (_service == null) {
328             _service = (PermissionLocalService)PortalBeanLocatorUtil.locate(PermissionLocalService.class.getName());
329         }
330 
331         return _service;
332     }
333 
334     public void setService(PermissionLocalService service) {
335         _service = service;
336     }
337 
338     private static PermissionLocalService _service;
339 }