Liferay 6.1.2-ce-ga3

com.liferay.portal.security.permission
Class InlineSQLHelperImpl

java.lang.Object
  extended by com.liferay.portal.security.permission.InlineSQLHelperImpl
All Implemented Interfaces:
InlineSQLHelper

public class InlineSQLHelperImpl
extends Object
implements InlineSQLHelper


Field Summary
static String FILTER_BY_RESOURCE_BLOCK_ID
           
static String FILTER_BY_RESOURCE_BLOCK_ID_OWNER
           
static String FIND_BY_RESOURCE_BLOCK_ID
           
static String JOIN_RESOURCE_PERMISSION
           
 
Constructor Summary
InlineSQLHelperImpl()
           
 
Method Summary
protected  Set<Long> getOwnerResourceBlockIds(long companyId, long[] groupIds, String className)
           
protected  String getOwnerResourceBlockIdsSQL(PermissionChecker permissionChecker, long checkGroupId, String className, Set<Long> ownerResourceBlockIds)
           
protected  Set<Long> getResourceBlockIds(long companyId, long[] groupIds, String className)
           
protected  long[] getRoleIds(long groupId)
           
protected  long[] getRoleIds(long[] groupIds)
           
protected  long getUserId()
           
protected  String getUserResourceBlockIdsSQL(PermissionChecker permissionChecker, long checkGroupId, long[] roleIds, String className, Set<Long> userResourceBlockIds)
           
 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.
protected  String replacePermissionCheckBlocks(String sql, String className, String classPKField, String userIdField, long[] groupIds, String bridgeJoin)
           
protected  String replacePermissionCheckJoin(String sql, String className, String classPKField, String userIdField, String groupIdField, long[] groupIds, String bridgeJoin)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILTER_BY_RESOURCE_BLOCK_ID

public static final String FILTER_BY_RESOURCE_BLOCK_ID

FILTER_BY_RESOURCE_BLOCK_ID_OWNER

public static final String FILTER_BY_RESOURCE_BLOCK_ID_OWNER

FIND_BY_RESOURCE_BLOCK_ID

public static final String FIND_BY_RESOURCE_BLOCK_ID

JOIN_RESOURCE_PERMISSION

public static final String JOIN_RESOURCE_PERMISSION
Constructor Detail

InlineSQLHelperImpl

public InlineSQLHelperImpl()
Method Detail

isEnabled

public boolean isEnabled()
Description copied from interface: InlineSQLHelper
Returns true if the inline SQL helper is enabled.

Specified by:
isEnabled in interface InlineSQLHelper
Returns:
true if the inline SQL helper is enabled; false otherwise

isEnabled

public boolean isEnabled(long groupId)
Description copied from interface: InlineSQLHelper
Returns true if the inline SQL helper is enabled for the group.

Specified by:
isEnabled in interface InlineSQLHelper
Parameters:
groupId - the primary key of the group
Returns:
true if the inline SQL helper is enabled for the group; false otherwise

isEnabled

public boolean isEnabled(long[] groupIds)
Description copied from interface: InlineSQLHelper
Returns true if the inline SQL helper is enabled for the groups.

Specified by:
isEnabled in interface InlineSQLHelper
Parameters:
groupIds - the primary keys of the groups
Returns:
true if the inline SQL helper is enabled for the groups; false otherwise

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     long groupId)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     long groupId,
                                     String bridgeJoin)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     long[] groupIds)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     long[] groupIds,
                                     String bridgeJoin)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     String userIdField)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     String userIdField,
                                     long groupId)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     String userIdField,
                                     long groupId,
                                     String bridgeJoin)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     String userIdField,
                                     long[] groupIds)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

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

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

public String replacePermissionCheck(String sql,
                                     String className,
                                     String classPKField,
                                     String userIdField,
                                     String bridgeJoin)
Description copied from interface: InlineSQLHelper
Modifies the SQL query to only match resources that the user has permission to view.

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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)

replacePermissionCheck

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

Specified by:
replacePermissionCheck in interface InlineSQLHelper
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

getOwnerResourceBlockIds

protected Set<Long> getOwnerResourceBlockIds(long companyId,
                                             long[] groupIds,
                                             String className)

getOwnerResourceBlockIdsSQL

protected String getOwnerResourceBlockIdsSQL(PermissionChecker permissionChecker,
                                             long checkGroupId,
                                             String className,
                                             Set<Long> ownerResourceBlockIds)

getResourceBlockIds

protected Set<Long> getResourceBlockIds(long companyId,
                                        long[] groupIds,
                                        String className)

getRoleIds

protected long[] getRoleIds(long groupId)

getRoleIds

protected long[] getRoleIds(long[] groupIds)

getUserId

protected long getUserId()

getUserResourceBlockIdsSQL

protected String getUserResourceBlockIdsSQL(PermissionChecker permissionChecker,
                                            long checkGroupId,
                                            long[] roleIds,
                                            String className,
                                            Set<Long> userResourceBlockIds)

replacePermissionCheckBlocks

protected String replacePermissionCheckBlocks(String sql,
                                              String className,
                                              String classPKField,
                                              String userIdField,
                                              long[] groupIds,
                                              String bridgeJoin)

replacePermissionCheckJoin

protected String replacePermissionCheckJoin(String sql,
                                            String className,
                                            String classPKField,
                                            String userIdField,
                                            String groupIdField,
                                            long[] groupIds,
                                            String bridgeJoin)

Liferay 6.1.2-ce-ga3