1   /**
2    * Copyright (c) 2000-2009 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(
33          java.util.List<com.liferay.portal.model.Permission> permissions,
34          long userId, java.util.List<com.liferay.portal.model.Group> groups,
35          long groupId) throws com.liferay.portal.SystemException {
36          return getFinder()
37                     .containsPermissions_2(permissions, userId, groups, groupId);
38      }
39  
40      public static boolean containsPermissions_4(
41          java.util.List<com.liferay.portal.model.Permission> permissions,
42          long userId, java.util.List<com.liferay.portal.model.Group> groups,
43          java.util.List<com.liferay.portal.model.Role> roles)
44          throws com.liferay.portal.SystemException {
45          return getFinder()
46                     .containsPermissions_4(permissions, userId, groups, roles);
47      }
48  
49      public static int countByGroupsPermissions(
50          java.util.List<com.liferay.portal.model.Permission> permissions,
51          java.util.List<com.liferay.portal.model.Group> groups)
52          throws com.liferay.portal.SystemException {
53          return getFinder().countByGroupsPermissions(permissions, groups);
54      }
55  
56      public static int countByGroupsRoles(
57          java.util.List<com.liferay.portal.model.Permission> permissions,
58          java.util.List<com.liferay.portal.model.Group> groups)
59          throws com.liferay.portal.SystemException {
60          return getFinder().countByGroupsRoles(permissions, groups);
61      }
62  
63      public static int countByRolesPermissions(
64          java.util.List<com.liferay.portal.model.Permission> permissions,
65          java.util.List<com.liferay.portal.model.Role> roles)
66          throws com.liferay.portal.SystemException {
67          return getFinder().countByRolesPermissions(permissions, roles);
68      }
69  
70      public static int countByUserGroupRole(
71          java.util.List<com.liferay.portal.model.Permission> permissions,
72          long userId, long groupId) throws com.liferay.portal.SystemException {
73          return getFinder().countByUserGroupRole(permissions, userId, groupId);
74      }
75  
76      public static int countByUsersPermissions(
77          java.util.List<com.liferay.portal.model.Permission> permissions,
78          long userId) throws com.liferay.portal.SystemException {
79          return getFinder().countByUsersPermissions(permissions, userId);
80      }
81  
82      public static int countByUsersRoles(
83          java.util.List<com.liferay.portal.model.Permission> permissions,
84          long userId) throws com.liferay.portal.SystemException {
85          return getFinder().countByUsersRoles(permissions, userId);
86      }
87  
88      public static java.util.List<com.liferay.portal.model.Permission> findByA_R(
89          java.lang.String actionId, long[] resourceIds)
90          throws com.liferay.portal.SystemException {
91          return getFinder().findByA_R(actionId, resourceIds);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Permission> findByG_R(
95          long groupId, long resourceId)
96          throws com.liferay.portal.SystemException {
97          return getFinder().findByG_R(groupId, resourceId);
98      }
99  
100     public static java.util.List<com.liferay.portal.model.Permission> findByR_R(
101         long roleId, long resourceId) throws com.liferay.portal.SystemException {
102         return getFinder().findByR_R(roleId, resourceId);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.Permission> findByU_R(
106         long userId, long resourceId) throws com.liferay.portal.SystemException {
107         return getFinder().findByU_R(userId, resourceId);
108     }
109 
110     public static java.util.List<com.liferay.portal.model.Permission> findByO_G_R(
111         long organizationId, long groupId, long resourceId)
112         throws com.liferay.portal.SystemException {
113         return getFinder().findByO_G_R(organizationId, groupId, resourceId);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.Permission> findByU_A_R(
117         long userId, java.lang.String[] actionIds, long resourceId)
118         throws com.liferay.portal.SystemException {
119         return getFinder().findByU_A_R(userId, actionIds, resourceId);
120     }
121 
122     public static java.util.List<com.liferay.portal.model.Permission> findByG_C_N_S_P(
123         long groupId, long companyId, java.lang.String name, int scope,
124         java.lang.String primKey) throws com.liferay.portal.SystemException {
125         return getFinder()
126                    .findByG_C_N_S_P(groupId, companyId, name, scope, primKey);
127     }
128 
129     public static java.util.List<com.liferay.portal.model.Permission> findByU_C_N_S_P(
130         long userId, long companyId, java.lang.String name, int scope,
131         java.lang.String primKey) throws com.liferay.portal.SystemException {
132         return getFinder()
133                    .findByU_C_N_S_P(userId, companyId, name, scope, primKey);
134     }
135 
136     public static PermissionFinder getFinder() {
137         return _finder;
138     }
139 
140     public void setFinder(PermissionFinder finder) {
141         _finder = finder;
142     }
143 
144     private static PermissionFinder _finder;
145 }