001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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    }