001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.security.permission;
016    
017    /**
018     * @author Raymond Augé
019     */
020    public class InlineSQLHelperUtil {
021    
022            public static InlineSQLHelper getInlineSQLHelper() {
023                    return _inlineSQLPermission;
024            }
025    
026            public static boolean isEnabled() {
027                    return getInlineSQLHelper().isEnabled();
028            }
029    
030            public static boolean isEnabled(long groupId) {
031                    return getInlineSQLHelper().isEnabled(groupId);
032            }
033    
034            public static boolean isEnabled(long[] groupIds) {
035                    return getInlineSQLHelper().isEnabled(groupIds);
036            }
037    
038            public static String replacePermissionCheck(
039                    String sql, String className, String classPKField) {
040    
041                    return getInlineSQLHelper().replacePermissionCheck(
042                            sql, className, classPKField);
043            }
044    
045            public static String replacePermissionCheck(
046                    String sql, String className, String classPKField, long groupId) {
047    
048                    return getInlineSQLHelper().replacePermissionCheck(
049                            sql, className, classPKField, groupId);
050            }
051    
052            public static String replacePermissionCheck(
053                    String sql, String className, String classPKField, long groupId,
054                    String bridgeJoin) {
055    
056                    return getInlineSQLHelper().replacePermissionCheck(
057                            sql, className, classPKField, groupId, bridgeJoin);
058            }
059    
060            public static String replacePermissionCheck(
061                    String sql, String className, String classPKField, long[] groupIds) {
062    
063                    return getInlineSQLHelper().replacePermissionCheck(
064                            sql, className, classPKField, groupIds);
065            }
066    
067            public static String replacePermissionCheck(
068                    String sql, String className, String classPKField, long[] groupIds,
069                    String bridgeJoin) {
070    
071                    return getInlineSQLHelper().replacePermissionCheck(
072                            sql, className, classPKField, groupIds, bridgeJoin);
073            }
074    
075            public static String replacePermissionCheck(
076                    String sql, String className, String classPKField, String userIdField) {
077    
078                    return getInlineSQLHelper().replacePermissionCheck(
079                            sql, className, classPKField, userIdField);
080            }
081    
082            public static String replacePermissionCheck(
083                    String sql, String className, String classPKField, String userIdField,
084                    long groupId) {
085    
086                    return getInlineSQLHelper().replacePermissionCheck(
087                            sql, className, classPKField, userIdField, groupId);
088            }
089    
090            public static String replacePermissionCheck(
091                    String sql, String className, String classPKField, String userIdField,
092                    long groupId, String bridgeJoin) {
093    
094                    return getInlineSQLHelper().replacePermissionCheck(
095                            sql, className, classPKField, userIdField, groupId, bridgeJoin);
096            }
097    
098            public static String replacePermissionCheck(
099                    String sql, String className, String classPKField, String userIdField,
100                    long[] groupIds) {
101    
102                    return getInlineSQLHelper().replacePermissionCheck(
103                            sql, className, classPKField, userIdField, groupIds);
104            }
105    
106            public static String replacePermissionCheck(
107                    String sql, String className, String classPKField, String userIdField,
108                    long[] groupIds, String bridgeJoin) {
109    
110                    return getInlineSQLHelper().replacePermissionCheck(
111                            sql, className, classPKField, userIdField, groupIds, bridgeJoin);
112            }
113    
114            public static String replacePermissionCheck(
115                    String sql, String className, String classPKField, String userIdField,
116                    String bridgeJoin) {
117    
118                    return getInlineSQLHelper().replacePermissionCheck(
119                            sql, className, classPKField, userIdField, bridgeJoin);
120            }
121    
122            public void setInlineSQLHelper(InlineSQLHelper inlineSQLPermission) {
123                    _inlineSQLPermission = inlineSQLPermission;
124            }
125    
126            private static InlineSQLHelper _inlineSQLPermission;
127    
128    }