1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="PermissionFinderUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class PermissionFinderUtil {
29      public static boolean containsPermissions_2(
30          java.util.List<com.liferay.portal.model.Permission> permissions,
31          long userId, java.util.List<com.liferay.portal.model.Group> groups,
32          long groupId) throws com.liferay.portal.SystemException {
33          return getFinder()
34                     .containsPermissions_2(permissions, userId, groups, groupId);
35      }
36  
37      public static boolean containsPermissions_4(
38          java.util.List<com.liferay.portal.model.Permission> permissions,
39          long userId, java.util.List<com.liferay.portal.model.Group> groups,
40          java.util.List<com.liferay.portal.model.Role> roles)
41          throws com.liferay.portal.SystemException {
42          return getFinder()
43                     .containsPermissions_4(permissions, userId, groups, roles);
44      }
45  
46      public static int countByGroupsPermissions(
47          java.util.List<com.liferay.portal.model.Permission> permissions,
48          java.util.List<com.liferay.portal.model.Group> groups)
49          throws com.liferay.portal.SystemException {
50          return getFinder().countByGroupsPermissions(permissions, groups);
51      }
52  
53      public static int countByGroupsRoles(
54          java.util.List<com.liferay.portal.model.Permission> permissions,
55          java.util.List<com.liferay.portal.model.Group> groups)
56          throws com.liferay.portal.SystemException {
57          return getFinder().countByGroupsRoles(permissions, groups);
58      }
59  
60      public static int countByRolesPermissions(
61          java.util.List<com.liferay.portal.model.Permission> permissions,
62          java.util.List<com.liferay.portal.model.Role> roles)
63          throws com.liferay.portal.SystemException {
64          return getFinder().countByRolesPermissions(permissions, roles);
65      }
66  
67      public static int countByUserGroupRole(
68          java.util.List<com.liferay.portal.model.Permission> permissions,
69          long userId, long groupId) throws com.liferay.portal.SystemException {
70          return getFinder().countByUserGroupRole(permissions, userId, groupId);
71      }
72  
73      public static int countByUsersPermissions(
74          java.util.List<com.liferay.portal.model.Permission> permissions,
75          long userId) throws com.liferay.portal.SystemException {
76          return getFinder().countByUsersPermissions(permissions, userId);
77      }
78  
79      public static int countByUsersRoles(
80          java.util.List<com.liferay.portal.model.Permission> permissions,
81          long userId) throws com.liferay.portal.SystemException {
82          return getFinder().countByUsersRoles(permissions, userId);
83      }
84  
85      public static java.util.List<com.liferay.portal.model.Permission> findByA_R(
86          java.lang.String actionId, long[] resourceIds)
87          throws com.liferay.portal.SystemException {
88          return getFinder().findByA_R(actionId, resourceIds);
89      }
90  
91      public static java.util.List<com.liferay.portal.model.Permission> findByG_R(
92          long groupId, long resourceId)
93          throws com.liferay.portal.SystemException {
94          return getFinder().findByG_R(groupId, resourceId);
95      }
96  
97      public static java.util.List<com.liferay.portal.model.Permission> findByR_R(
98          long roleId, long resourceId) throws com.liferay.portal.SystemException {
99          return getFinder().findByR_R(roleId, resourceId);
100     }
101 
102     public static java.util.List<com.liferay.portal.model.Permission> findByU_R(
103         long userId, long resourceId) throws com.liferay.portal.SystemException {
104         return getFinder().findByU_R(userId, resourceId);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.Permission> findByO_G_R(
108         long organizationId, long groupId, long resourceId)
109         throws com.liferay.portal.SystemException {
110         return getFinder().findByO_G_R(organizationId, groupId, resourceId);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Permission> findByU_A_R(
114         long userId, java.lang.String[] actionIds, long resourceId)
115         throws com.liferay.portal.SystemException {
116         return getFinder().findByU_A_R(userId, actionIds, resourceId);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Permission> findByG_C_N_S_P(
120         long groupId, long companyId, java.lang.String name, int scope,
121         java.lang.String primKey) throws com.liferay.portal.SystemException {
122         return getFinder()
123                    .findByG_C_N_S_P(groupId, companyId, name, scope, primKey);
124     }
125 
126     public static java.util.List<com.liferay.portal.model.Permission> findByU_C_N_S_P(
127         long userId, long companyId, java.lang.String name, int scope,
128         java.lang.String primKey) throws com.liferay.portal.SystemException {
129         return getFinder()
130                    .findByU_C_N_S_P(userId, companyId, name, scope, primKey);
131     }
132 
133     public static PermissionFinder getFinder() {
134         return _finder;
135     }
136 
137     public void setFinder(PermissionFinder finder) {
138         _finder = finder;
139     }
140 
141     private static PermissionFinder _finder;
142 }