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     * @see    InlineSQLHelper
020     */
021    public class InlineSQLHelperUtil {
022    
023            public static InlineSQLHelper getInlineSQLHelper() {
024                    return _inlineSQLPermission;
025            }
026    
027            public static boolean isEnabled() {
028                    return getInlineSQLHelper().isEnabled();
029            }
030    
031            public static boolean isEnabled(long groupId) {
032                    return getInlineSQLHelper().isEnabled(groupId);
033            }
034    
035            public static boolean isEnabled(long[] groupIds) {
036                    return getInlineSQLHelper().isEnabled(groupIds);
037            }
038    
039            public static String replacePermissionCheck(
040                    String sql, String className, String classPKField) {
041    
042                    return getInlineSQLHelper().replacePermissionCheck(
043                            sql, className, classPKField);
044            }
045    
046            public static String replacePermissionCheck(
047                    String sql, String className, String classPKField, long groupId) {
048    
049                    return getInlineSQLHelper().replacePermissionCheck(
050                            sql, className, classPKField, groupId);
051            }
052    
053            public static String replacePermissionCheck(
054                    String sql, String className, String classPKField, long groupId,
055                    String bridgeJoin) {
056    
057                    return getInlineSQLHelper().replacePermissionCheck(
058                            sql, className, classPKField, groupId, bridgeJoin);
059            }
060    
061            public static String replacePermissionCheck(
062                    String sql, String className, String classPKField, long[] groupIds) {
063    
064                    return getInlineSQLHelper().replacePermissionCheck(
065                            sql, className, classPKField, groupIds);
066            }
067    
068            public static String replacePermissionCheck(
069                    String sql, String className, String classPKField, long[] groupIds,
070                    String bridgeJoin) {
071    
072                    return getInlineSQLHelper().replacePermissionCheck(
073                            sql, className, classPKField, groupIds, bridgeJoin);
074            }
075    
076            public static String replacePermissionCheck(
077                    String sql, String className, String classPKField, String userIdField) {
078    
079                    return getInlineSQLHelper().replacePermissionCheck(
080                            sql, className, classPKField, userIdField);
081            }
082    
083            public static String replacePermissionCheck(
084                    String sql, String className, String classPKField, String userIdField,
085                    long groupId) {
086    
087                    return getInlineSQLHelper().replacePermissionCheck(
088                            sql, className, classPKField, userIdField, groupId);
089            }
090    
091            public static String replacePermissionCheck(
092                    String sql, String className, String classPKField, String userIdField,
093                    long groupId, String bridgeJoin) {
094    
095                    return getInlineSQLHelper().replacePermissionCheck(
096                            sql, className, classPKField, userIdField, groupId, bridgeJoin);
097            }
098    
099            public static String replacePermissionCheck(
100                    String sql, String className, String classPKField, String userIdField,
101                    long[] groupIds) {
102    
103                    return getInlineSQLHelper().replacePermissionCheck(
104                            sql, className, classPKField, userIdField, groupIds);
105            }
106    
107            public static String replacePermissionCheck(
108                    String sql, String className, String classPKField, String userIdField,
109                    long[] groupIds, String bridgeJoin) {
110    
111                    return getInlineSQLHelper().replacePermissionCheck(
112                            sql, className, classPKField, userIdField, groupIds, bridgeJoin);
113            }
114    
115            public static String replacePermissionCheck(
116                    String sql, String className, String classPKField, String userIdField,
117                    String bridgeJoin) {
118    
119                    return getInlineSQLHelper().replacePermissionCheck(
120                            sql, className, classPKField, userIdField, bridgeJoin);
121            }
122    
123            public void setInlineSQLHelper(InlineSQLHelper inlineSQLPermission) {
124                    _inlineSQLPermission = inlineSQLPermission;
125            }
126    
127            private static InlineSQLHelper _inlineSQLPermission;
128    
129    }