1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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   * <code>com.liferay.portal.service.PermissionService</code>
37   * bean. The static methods of this class calls the same methods of the bean
38   * instance. It's convenient to be able to just write one line to call a method
39   * on a bean instead of writing a lookup call and a method call.
40   * </p>
41   *
42   * @author Brian Wing Shun Chan
43   *
44   * @see com.liferay.portal.service.PermissionService
45   *
46   */
47  public class PermissionServiceUtil {
48      public static void checkPermission(long groupId, java.lang.String name,
49          java.lang.String primKey)
50          throws com.liferay.portal.PortalException,
51              com.liferay.portal.SystemException, java.rmi.RemoteException {
52          _service.checkPermission(groupId, name, primKey);
53      }
54  
55      public static boolean hasGroupPermission(long groupId,
56          java.lang.String actionId, long resourceId)
57          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
58          return _service.hasGroupPermission(groupId, actionId, resourceId);
59      }
60  
61      public static boolean hasUserPermission(long userId,
62          java.lang.String actionId, long resourceId)
63          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
64          return _service.hasUserPermission(userId, actionId, resourceId);
65      }
66  
67      public static boolean hasUserPermissions(long userId, long groupId,
68          java.lang.String actionId, long[] resourceIds,
69          com.liferay.portal.security.permission.PermissionCheckerBag permissionCheckerBag)
70          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
71          return _service.hasUserPermissions(userId, groupId, actionId,
72              resourceIds, permissionCheckerBag);
73      }
74  
75      public static void setGroupPermissions(long groupId,
76          java.lang.String[] actionIds, long resourceId)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException, java.rmi.RemoteException {
79          _service.setGroupPermissions(groupId, actionIds, resourceId);
80      }
81  
82      public static void setGroupPermissions(java.lang.String className,
83          java.lang.String classPK, long groupId, java.lang.String[] actionIds,
84          long resourceId)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException, java.rmi.RemoteException {
87          _service.setGroupPermissions(className, classPK, groupId, actionIds,
88              resourceId);
89      }
90  
91      public static void setOrgGroupPermissions(long organizationId,
92          long groupId, java.lang.String[] actionIds, long resourceId)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException, java.rmi.RemoteException {
95          _service.setOrgGroupPermissions(organizationId, groupId, actionIds,
96              resourceId);
97      }
98  
99      public static void setRolePermission(long roleId, long groupId,
100         java.lang.String name, int scope, java.lang.String primKey,
101         java.lang.String actionId)
102         throws com.liferay.portal.PortalException,
103             com.liferay.portal.SystemException, java.rmi.RemoteException {
104         _service.setRolePermission(roleId, groupId, name, scope, primKey,
105             actionId);
106     }
107 
108     public static void setRolePermissions(long roleId, long groupId,
109         java.lang.String[] actionIds, long resourceId)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException, java.rmi.RemoteException {
112         _service.setRolePermissions(roleId, groupId, actionIds, resourceId);
113     }
114 
115     public static void setUserPermissions(long userId, long groupId,
116         java.lang.String[] actionIds, long resourceId)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException, java.rmi.RemoteException {
119         _service.setUserPermissions(userId, groupId, actionIds, resourceId);
120     }
121 
122     public static void unsetRolePermission(long roleId, long groupId,
123         long permissionId)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException, java.rmi.RemoteException {
126         _service.unsetRolePermission(roleId, groupId, permissionId);
127     }
128 
129     public static void unsetRolePermission(long roleId, long groupId,
130         java.lang.String name, int scope, java.lang.String primKey,
131         java.lang.String actionId)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException, java.rmi.RemoteException {
134         _service.unsetRolePermission(roleId, groupId, name, scope, primKey,
135             actionId);
136     }
137 
138     public static void unsetRolePermissions(long roleId, long groupId,
139         java.lang.String name, int scope, java.lang.String actionId)
140         throws com.liferay.portal.PortalException,
141             com.liferay.portal.SystemException, java.rmi.RemoteException {
142         _service.unsetRolePermissions(roleId, groupId, name, scope, actionId);
143     }
144 
145     public static void unsetUserPermissions(long userId, long groupId,
146         java.lang.String[] actionIds, long resourceId)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException, java.rmi.RemoteException {
149         _service.unsetUserPermissions(userId, groupId, actionIds, resourceId);
150     }
151 
152     public static PermissionService getService() {
153         return _service;
154     }
155 
156     public void setService(PermissionService service) {
157         _service = service;
158     }
159 
160     private static PermissionService _service;
161 }