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.persistence;
24  
25  /**
26   * <a href="PermissionFinderUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class PermissionFinderUtil {
32      public static boolean containsPermissions_2(java.util.List permissions,
33          long userId, java.util.List groups, long groupId)
34          throws com.liferay.portal.SystemException {
35          return getFinder().containsPermissions_2(permissions, userId, groups,
36              groupId);
37      }
38  
39      public static boolean containsPermissions_4(java.util.List permissions,
40          long userId, java.util.List groups, java.util.List roles)
41          throws com.liferay.portal.SystemException {
42          return getFinder().containsPermissions_4(permissions, userId, groups,
43              roles);
44      }
45  
46      public static int countByGroupsPermissions(java.util.List permissions,
47          java.util.List groups) throws com.liferay.portal.SystemException {
48          return getFinder().countByGroupsPermissions(permissions, groups);
49      }
50  
51      public static int countByGroupsRoles(java.util.List permissions,
52          java.util.List groups) throws com.liferay.portal.SystemException {
53          return getFinder().countByGroupsRoles(permissions, groups);
54      }
55  
56      public static int countByRolesPermissions(java.util.List permissions,
57          java.util.List roles) throws com.liferay.portal.SystemException {
58          return getFinder().countByRolesPermissions(permissions, roles);
59      }
60  
61      public static int countByUserGroupRole(java.util.List permissions,
62          long userId, long groupId) throws com.liferay.portal.SystemException {
63          return getFinder().countByUserGroupRole(permissions, userId, groupId);
64      }
65  
66      public static int countByUsersPermissions(java.util.List permissions,
67          long userId) throws com.liferay.portal.SystemException {
68          return getFinder().countByUsersPermissions(permissions, userId);
69      }
70  
71      public static int countByUsersRoles(java.util.List permissions, long userId)
72          throws com.liferay.portal.SystemException {
73          return getFinder().countByUsersRoles(permissions, userId);
74      }
75  
76      public static java.util.List findByA_R(java.lang.String actionId,
77          long[] resourceIds) throws com.liferay.portal.SystemException {
78          return getFinder().findByA_R(actionId, resourceIds);
79      }
80  
81      public static java.util.List findByG_R(long groupId, long resourceId)
82          throws com.liferay.portal.SystemException {
83          return getFinder().findByG_R(groupId, resourceId);
84      }
85  
86      public static java.util.List findByR_R(long roleId, long resourceId)
87          throws com.liferay.portal.SystemException {
88          return getFinder().findByR_R(roleId, resourceId);
89      }
90  
91      public static java.util.List findByU_R(long userId, long resourceId)
92          throws com.liferay.portal.SystemException {
93          return getFinder().findByU_R(userId, resourceId);
94      }
95  
96      public static java.util.List findByO_G_R(long organizationId, long groupId,
97          long resourceId) throws com.liferay.portal.SystemException {
98          return getFinder().findByO_G_R(organizationId, groupId, resourceId);
99      }
100 
101     public static java.util.List findByU_A_R(long userId,
102         java.lang.String[] actionIds, long resourceId)
103         throws com.liferay.portal.SystemException {
104         return getFinder().findByU_A_R(userId, actionIds, resourceId);
105     }
106 
107     public static java.util.List findByG_C_N_S_P(long groupId, long companyId,
108         java.lang.String name, int scope, java.lang.String primKey)
109         throws com.liferay.portal.SystemException {
110         return getFinder().findByG_C_N_S_P(groupId, companyId, name, scope,
111             primKey);
112     }
113 
114     public static java.util.List findByU_C_N_S_P(long userId, long companyId,
115         java.lang.String name, int scope, java.lang.String primKey)
116         throws com.liferay.portal.SystemException {
117         return getFinder().findByU_C_N_S_P(userId, companyId, name, scope,
118             primKey);
119     }
120 
121     public static PermissionFinder getFinder() {
122         return _getUtil()._finder;
123     }
124 
125     public void setFinder(PermissionFinder finder) {
126         _finder = finder;
127     }
128 
129     private static PermissionFinderUtil _getUtil() {
130         if (_util == null) {
131             _util = (PermissionFinderUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
132         }
133 
134         return _util;
135     }
136 
137     private static final String _UTIL = PermissionFinderUtil.class.getName();
138     private static PermissionFinderUtil _util;
139     private PermissionFinder _finder;
140 }