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;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="PermissionServiceUtil.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 PermissionService} 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       PermissionService
37   * @generated
38   */
39  public class PermissionServiceUtil {
40      public static void checkPermission(long groupId, long resourceId)
41          throws com.liferay.portal.kernel.exception.PortalException,
42              com.liferay.portal.kernel.exception.SystemException {
43          getService().checkPermission(groupId, resourceId);
44      }
45  
46      public static void checkPermission(long groupId, java.lang.String name,
47          long primKey)
48          throws com.liferay.portal.kernel.exception.PortalException,
49              com.liferay.portal.kernel.exception.SystemException {
50          getService().checkPermission(groupId, name, primKey);
51      }
52  
53      public static void checkPermission(long groupId, java.lang.String name,
54          java.lang.String primKey)
55          throws com.liferay.portal.kernel.exception.PortalException,
56              com.liferay.portal.kernel.exception.SystemException {
57          getService().checkPermission(groupId, name, primKey);
58      }
59  
60      public static boolean hasGroupPermission(long groupId,
61          java.lang.String actionId, long resourceId)
62          throws com.liferay.portal.kernel.exception.SystemException {
63          return getService().hasGroupPermission(groupId, actionId, resourceId);
64      }
65  
66      public static boolean hasUserPermission(long userId,
67          java.lang.String actionId, long resourceId)
68          throws com.liferay.portal.kernel.exception.SystemException {
69          return getService().hasUserPermission(userId, actionId, resourceId);
70      }
71  
72      public static boolean hasUserPermissions(long userId, long groupId,
73          java.util.List<com.liferay.portal.model.Resource> resources,
74          java.lang.String actionId,
75          com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
76          throws com.liferay.portal.kernel.exception.PortalException,
77              com.liferay.portal.kernel.exception.SystemException {
78          return getService()
79                     .hasUserPermissions(userId, groupId, resources, actionId,
80              permissionCheckerBag);
81      }
82  
83      public static void setGroupPermissions(long groupId,
84          java.lang.String[] actionIds, long resourceId)
85          throws com.liferay.portal.kernel.exception.PortalException,
86              com.liferay.portal.kernel.exception.SystemException {
87          getService().setGroupPermissions(groupId, actionIds, resourceId);
88      }
89  
90      public static void setGroupPermissions(java.lang.String className,
91          java.lang.String classPK, long groupId, java.lang.String[] actionIds,
92          long resourceId)
93          throws com.liferay.portal.kernel.exception.PortalException,
94              com.liferay.portal.kernel.exception.SystemException {
95          getService()
96              .setGroupPermissions(className, classPK, groupId, actionIds,
97              resourceId);
98      }
99  
100     public static void setOrgGroupPermissions(long organizationId,
101         long groupId, java.lang.String[] actionIds, long resourceId)
102         throws com.liferay.portal.kernel.exception.PortalException,
103             com.liferay.portal.kernel.exception.SystemException {
104         getService()
105             .setOrgGroupPermissions(organizationId, groupId, actionIds,
106             resourceId);
107     }
108 
109     public static void setRolePermission(long roleId, long groupId,
110         java.lang.String name, int scope, java.lang.String primKey,
111         java.lang.String actionId)
112         throws com.liferay.portal.kernel.exception.PortalException,
113             com.liferay.portal.kernel.exception.SystemException {
114         getService()
115             .setRolePermission(roleId, groupId, name, scope, primKey, actionId);
116     }
117 
118     public static void setRolePermissions(long roleId, long groupId,
119         java.lang.String[] actionIds, long resourceId)
120         throws com.liferay.portal.kernel.exception.PortalException,
121             com.liferay.portal.kernel.exception.SystemException {
122         getService().setRolePermissions(roleId, groupId, actionIds, resourceId);
123     }
124 
125     public static void setUserPermissions(long userId, long groupId,
126         java.lang.String[] actionIds, long resourceId)
127         throws com.liferay.portal.kernel.exception.PortalException,
128             com.liferay.portal.kernel.exception.SystemException {
129         getService().setUserPermissions(userId, groupId, actionIds, resourceId);
130     }
131 
132     public static void unsetRolePermission(long roleId, long groupId,
133         long permissionId)
134         throws com.liferay.portal.kernel.exception.PortalException,
135             com.liferay.portal.kernel.exception.SystemException {
136         getService().unsetRolePermission(roleId, groupId, permissionId);
137     }
138 
139     public static void unsetRolePermission(long roleId, long groupId,
140         java.lang.String name, int scope, java.lang.String primKey,
141         java.lang.String actionId)
142         throws com.liferay.portal.kernel.exception.PortalException,
143             com.liferay.portal.kernel.exception.SystemException {
144         getService()
145             .unsetRolePermission(roleId, groupId, name, scope, primKey, actionId);
146     }
147 
148     public static void unsetRolePermissions(long roleId, long groupId,
149         java.lang.String name, int scope, java.lang.String actionId)
150         throws com.liferay.portal.kernel.exception.PortalException,
151             com.liferay.portal.kernel.exception.SystemException {
152         getService().unsetRolePermissions(roleId, groupId, name, scope, actionId);
153     }
154 
155     public static void unsetUserPermissions(long userId, long groupId,
156         java.lang.String[] actionIds, long resourceId)
157         throws com.liferay.portal.kernel.exception.PortalException,
158             com.liferay.portal.kernel.exception.SystemException {
159         getService().unsetUserPermissions(userId, groupId, actionIds, resourceId);
160     }
161 
162     public static PermissionService getService() {
163         if (_service == null) {
164             _service = (PermissionService)PortalBeanLocatorUtil.locate(PermissionService.class.getName());
165         }
166 
167         return _service;
168     }
169 
170     public void setService(PermissionService service) {
171         _service = service;
172     }
173 
174     private static PermissionService _service;
175 }