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