1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.security.permission;
16  
17  /**
18   * <a href="InlineSQLHelperUtil.java.html"><b><i>View Source</i></b></a>
19   *
20   * @author Raymond Augé
21   */
22  public class InlineSQLHelperUtil {
23  
24      public static boolean isEnabled() {
25          return getInlineSQLHelper().isEnabled();
26      }
27  
28      public static boolean isEnabled(long groupId) {
29          return getInlineSQLHelper().isEnabled(groupId);
30      }
31  
32      public static String replacePermissionCheck(
33          String sql, String className, String classPKField, String userIdField) {
34  
35          return getInlineSQLHelper().replacePermissionCheck(
36              sql, className, classPKField, userIdField);
37      }
38  
39      public static String replacePermissionCheck(
40          String sql, String className, String classPKField, String userIdField,
41          long groupId) {
42  
43          return getInlineSQLHelper().replacePermissionCheck(
44              sql, className, classPKField, userIdField, groupId);
45      }
46  
47      public static String replacePermissionCheck(
48          String sql, String className, String classPKField, String userIdField,
49          long groupId, String bridgeJoin) {
50  
51          return getInlineSQLHelper().replacePermissionCheck(
52              sql, className, classPKField, userIdField, groupId, bridgeJoin);
53      }
54  
55      public static String replacePermissionCheck(
56          String sql, String className, String classPKField, String userIdField,
57          String bridgeJoin) {
58  
59          return getInlineSQLHelper().replacePermissionCheck(
60              sql, className, classPKField, userIdField, bridgeJoin);
61      }
62  
63      public void setInlineSQLHelper(InlineSQLHelper inlineSQLPermission) {
64          _inlineSQLPermission = inlineSQLPermission;
65      }
66  
67      public static InlineSQLHelper getInlineSQLHelper() {
68          return _inlineSQLPermission;
69      }
70  
71      private static InlineSQLHelper _inlineSQLPermission;
72  
73  }