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;
24  
25  
26  /**
27   * <a href="PermissionServiceUtil.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 static methods for the
36   * {@link PermissionService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       PermissionService
44   * @generated
45   */
46  public class PermissionServiceUtil {
47      public static void checkPermission(long groupId, long resourceId)
48          throws com.liferay.portal.PortalException,
49              com.liferay.portal.SystemException, java.rmi.RemoteException {
50          getService().checkPermission(groupId, resourceId);
51      }
52  
53      public static void checkPermission(long groupId, java.lang.String name,
54          long primKey)
55          throws com.liferay.portal.PortalException,
56              com.liferay.portal.SystemException, java.rmi.RemoteException {
57          getService().checkPermission(groupId, name, primKey);
58      }
59  
60      public static void checkPermission(long groupId, java.lang.String name,
61          java.lang.String primKey)
62          throws com.liferay.portal.PortalException,
63              com.liferay.portal.SystemException, java.rmi.RemoteException {
64          getService().checkPermission(groupId, name, primKey);
65      }
66  
67      public static boolean hasGroupPermission(long groupId,
68          java.lang.String actionId, long resourceId)
69          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
70          return getService().hasGroupPermission(groupId, actionId, resourceId);
71      }
72  
73      public static boolean hasUserPermission(long userId,
74          java.lang.String actionId, long resourceId)
75          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
76          return getService().hasUserPermission(userId, actionId, resourceId);
77      }
78  
79      public static boolean hasUserPermissions(long userId, long groupId,
80          java.util.List<com.liferay.portal.model.Resource> resources,
81          java.lang.String actionId,
82          com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException, java.rmi.RemoteException {
85          return getService()
86                     .hasUserPermissions(userId, groupId, resources, actionId,
87              permissionCheckerBag);
88      }
89  
90      public static void setGroupPermissions(long groupId,
91          java.lang.String[] actionIds, long resourceId)
92          throws com.liferay.portal.PortalException,
93              com.liferay.portal.SystemException, java.rmi.RemoteException {
94          getService().setGroupPermissions(groupId, actionIds, resourceId);
95      }
96  
97      public static void setGroupPermissions(java.lang.String className,
98          java.lang.String classPK, long groupId, java.lang.String[] actionIds,
99          long resourceId)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException, java.rmi.RemoteException {
102         getService()
103             .setGroupPermissions(className, classPK, groupId, actionIds,
104             resourceId);
105     }
106 
107     public static void setOrgGroupPermissions(long organizationId,
108         long groupId, java.lang.String[] actionIds, long resourceId)
109         throws com.liferay.portal.PortalException,
110             com.liferay.portal.SystemException, java.rmi.RemoteException {
111         getService()
112             .setOrgGroupPermissions(organizationId, groupId, actionIds,
113             resourceId);
114     }
115 
116     public static void setRolePermission(long roleId, long groupId,
117         java.lang.String name, int scope, java.lang.String primKey,
118         java.lang.String actionId)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException, java.rmi.RemoteException {
121         getService()
122             .setRolePermission(roleId, groupId, name, scope, primKey, actionId);
123     }
124 
125     public static void setRolePermissions(long roleId, long groupId,
126         java.lang.String[] actionIds, long resourceId)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException, java.rmi.RemoteException {
129         getService().setRolePermissions(roleId, groupId, actionIds, resourceId);
130     }
131 
132     public static void setUserPermissions(long userId, long groupId,
133         java.lang.String[] actionIds, long resourceId)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException, java.rmi.RemoteException {
136         getService().setUserPermissions(userId, groupId, actionIds, resourceId);
137     }
138 
139     public static void unsetRolePermission(long roleId, long groupId,
140         long permissionId)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException, java.rmi.RemoteException {
143         getService().unsetRolePermission(roleId, groupId, permissionId);
144     }
145 
146     public static void unsetRolePermission(long roleId, long groupId,
147         java.lang.String name, int scope, java.lang.String primKey,
148         java.lang.String actionId)
149         throws com.liferay.portal.PortalException,
150             com.liferay.portal.SystemException, java.rmi.RemoteException {
151         getService()
152             .unsetRolePermission(roleId, groupId, name, scope, primKey, actionId);
153     }
154 
155     public static void unsetRolePermissions(long roleId, long groupId,
156         java.lang.String name, int scope, java.lang.String actionId)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException, java.rmi.RemoteException {
159         getService().unsetRolePermissions(roleId, groupId, name, scope, actionId);
160     }
161 
162     public static void unsetUserPermissions(long userId, long groupId,
163         java.lang.String[] actionIds, long resourceId)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException, java.rmi.RemoteException {
166         getService().unsetUserPermissions(userId, groupId, actionIds, resourceId);
167     }
168 
169     public static PermissionService getService() {
170         if (_service == null) {
171             throw new RuntimeException("PermissionService is not set");
172         }
173 
174         return _service;
175     }
176 
177     public void setService(PermissionService service) {
178         _service = service;
179     }
180 
181     private static PermissionService _service;
182 }