001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.service.persistence;
022:
023: /**
024: * <a href="PermissionFinderUtil.java.html"><b><i>View Source</i></b></a>
025: *
026: * @author Brian Wing Shun Chan
027: *
028: */
029: public class PermissionFinderUtil {
030: public static boolean containsPermissions_2(
031: java.util.List permissions, long userId,
032: java.util.List groups, long groupId)
033: throws com.liferay.portal.SystemException {
034: return getFinder().containsPermissions_2(permissions, userId,
035: groups, groupId);
036: }
037:
038: public static boolean containsPermissions_4(
039: java.util.List permissions, long userId,
040: java.util.List groups, java.util.List roles)
041: throws com.liferay.portal.SystemException {
042: return getFinder().containsPermissions_4(permissions, userId,
043: groups, roles);
044: }
045:
046: public static int countByGroupsPermissions(
047: java.util.List permissions, java.util.List groups)
048: throws com.liferay.portal.SystemException {
049: return getFinder()
050: .countByGroupsPermissions(permissions, groups);
051: }
052:
053: public static int countByGroupsRoles(java.util.List permissions,
054: java.util.List groups)
055: throws com.liferay.portal.SystemException {
056: return getFinder().countByGroupsRoles(permissions, groups);
057: }
058:
059: public static int countByRolesPermissions(
060: java.util.List permissions, java.util.List roles)
061: throws com.liferay.portal.SystemException {
062: return getFinder().countByRolesPermissions(permissions, roles);
063: }
064:
065: public static int countByUserGroupRole(java.util.List permissions,
066: long userId, long groupId)
067: throws com.liferay.portal.SystemException {
068: return getFinder().countByUserGroupRole(permissions, userId,
069: groupId);
070: }
071:
072: public static int countByUsersPermissions(
073: java.util.List permissions, long userId)
074: throws com.liferay.portal.SystemException {
075: return getFinder().countByUsersPermissions(permissions, userId);
076: }
077:
078: public static int countByUsersRoles(java.util.List permissions,
079: long userId) throws com.liferay.portal.SystemException {
080: return getFinder().countByUsersRoles(permissions, userId);
081: }
082:
083: public static java.util.List findByA_R(java.lang.String actionId,
084: long[] resourceIds)
085: throws com.liferay.portal.SystemException {
086: return getFinder().findByA_R(actionId, resourceIds);
087: }
088:
089: public static java.util.List findByG_R(long groupId, long resourceId)
090: throws com.liferay.portal.SystemException {
091: return getFinder().findByG_R(groupId, resourceId);
092: }
093:
094: public static java.util.List findByR_R(long roleId, long resourceId)
095: throws com.liferay.portal.SystemException {
096: return getFinder().findByR_R(roleId, resourceId);
097: }
098:
099: public static java.util.List findByU_R(long userId, long resourceId)
100: throws com.liferay.portal.SystemException {
101: return getFinder().findByU_R(userId, resourceId);
102: }
103:
104: public static java.util.List findByO_G_R(long organizationId,
105: long groupId, long resourceId)
106: throws com.liferay.portal.SystemException {
107: return getFinder().findByO_G_R(organizationId, groupId,
108: resourceId);
109: }
110:
111: public static java.util.List findByU_A_R(long userId,
112: java.lang.String[] actionIds, long resourceId)
113: throws com.liferay.portal.SystemException {
114: return getFinder().findByU_A_R(userId, actionIds, resourceId);
115: }
116:
117: public static java.util.List findByG_C_N_S_P(long groupId,
118: long companyId, java.lang.String name, int scope,
119: java.lang.String primKey)
120: throws com.liferay.portal.SystemException {
121: return getFinder().findByG_C_N_S_P(groupId, companyId, name,
122: scope, primKey);
123: }
124:
125: public static java.util.List findByU_C_N_S_P(long userId,
126: long companyId, java.lang.String name, int scope,
127: java.lang.String primKey)
128: throws com.liferay.portal.SystemException {
129: return getFinder().findByU_C_N_S_P(userId, companyId, name,
130: scope, primKey);
131: }
132:
133: public static PermissionFinder getFinder() {
134: return _getUtil()._finder;
135: }
136:
137: public void setFinder(PermissionFinder finder) {
138: _finder = finder;
139: }
140:
141: private static PermissionFinderUtil _getUtil() {
142: if (_util == null) {
143: _util = (PermissionFinderUtil) com.liferay.portal.kernel.bean.BeanLocatorUtil
144: .locate(_UTIL);
145: }
146:
147: return _util;
148: }
149:
150: private static final String _UTIL = PermissionFinderUtil.class
151: .getName();
152: private static PermissionFinderUtil _util;
153: private PermissionFinder _finder;
154: }
|