001    /**
002     * Copyright (c) 2000-2010 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 boolean isEnabled() {
023                    return getInlineSQLHelper().isEnabled();
024            }
025    
026            public static boolean isEnabled(long groupId) {
027                    return getInlineSQLHelper().isEnabled(groupId);
028            }
029    
030            public static String replacePermissionCheck(
031                    String sql, String className, String classPKField, String userIdField) {
032    
033                    return getInlineSQLHelper().replacePermissionCheck(
034                            sql, className, classPKField, userIdField);
035            }
036    
037            public static String replacePermissionCheck(
038                    String sql, String className, String classPKField, String userIdField,
039                    long groupId) {
040    
041                    return getInlineSQLHelper().replacePermissionCheck(
042                            sql, className, classPKField, userIdField, groupId);
043            }
044    
045            public static String replacePermissionCheck(
046                    String sql, String className, String classPKField, String userIdField,
047                    long groupId, String bridgeJoin) {
048    
049                    return getInlineSQLHelper().replacePermissionCheck(
050                            sql, className, classPKField, userIdField, groupId, bridgeJoin);
051            }
052    
053            public static String replacePermissionCheck(
054                    String sql, String className, String classPKField, String userIdField,
055                    String bridgeJoin) {
056    
057                    return getInlineSQLHelper().replacePermissionCheck(
058                            sql, className, classPKField, userIdField, bridgeJoin);
059            }
060    
061            public void setInlineSQLHelper(InlineSQLHelper inlineSQLPermission) {
062                    _inlineSQLPermission = inlineSQLPermission;
063            }
064    
065            public static InlineSQLHelper getInlineSQLHelper() {
066                    return _inlineSQLPermission;
067            }
068    
069            private static InlineSQLHelper _inlineSQLPermission;
070    
071    }