Liferay 6.2-ce-ga5

com.liferay.portal.security.permission
Interface InlineSQLHelper


public interface InlineSQLHelper

Provides utility methods for filtering SQL queries by the user's permissions.


Method Summary
 boolean isEnabled()
          Returns true if the inline SQL helper is enabled.
 boolean isEnabled(long groupId)
          Returns true if the inline SQL helper is enabled for the group.
 boolean isEnabled(long[] groupIds)
          Returns true if the inline SQL helper is enabled for the groups.
 String replacePermissionCheck(String sql, String className, String classPKField)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, long groupId)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, long[] groupIds)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, long[] groupIds, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, long groupId, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, long groupId)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, long[] groupIds)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, long[] groupIds, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, long groupId, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 String replacePermissionCheck(String sql, String className, String classPKField, String userIdField, String groupIdField, long[] groupIds, String bridgeJoin)
          Modifies the SQL query to only match resources that the user has permission to view.
 

Method Detail

isEnabled

boolean isEnabled()
Returns true if the inline SQL helper is enabled.

Returns:
true if the inline SQL helper is enabled; false otherwise

isEnabled

boolean isEnabled(long groupId)
Returns true if the inline SQL helper is enabled for the group.

Parameters:
groupId - the primary key of the group
Returns:
true if the inline SQL helper is enabled for the group; false otherwise

isEnabled

boolean isEnabled(long[] groupIds)
Returns true if the inline SQL helper is enabled for the groups.

Parameters:
groupIds - the primary keys of the groups
Returns:
true if the inline SQL helper is enabled for the groups; false otherwise

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              long groupId)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
groupId - the primary key of the group containing the resources (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              long groupId,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
groupId - the primary key of the group containing the resources (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              long[] groupIds)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
groupIds - the primary keys of the groups containing the resources (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              long[] groupIds,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
groupIds - the primary keys of the groups containing the resources (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              long groupId)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
groupId - the primary key of the group containing the resources (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              long groupId,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
groupId - the primary key of the group containing the resources (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              long[] groupIds)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
groupIds - the primary keys of the groups containing the resources (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              long[] groupIds,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
groupIds - the primary keys of the groups containing the resources (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

replacePermissionCheck

String replacePermissionCheck(String sql,
                              String className,
                              String classPKField,
                              String userIdField,
                              String groupIdField,
                              long[] groupIds,
                              String bridgeJoin)
Modifies the SQL query to only match resources that the user has permission to view.

Parameters:
sql - the SQL query
className - the fully qualified class name of the resources matched by the query
classPKField - the name of the column containing the resource's primary key
userIdField - the name of the column containing the resource owner's primary key (optionally null)
groupIdField - the name of the column containing the resource's group ID (optionally null)
groupIds - the primary keys of the groups containing the resources (optionally null)
bridgeJoin - an additional join clause to insert before the permission join (optionally null)
Returns:
the modified SQL query

Liferay 6.2-ce-ga5