Interface SpacePermissionQueryBuilder

All Known Implementing Classes:
SpacePermissionQueryBuilderImpl

@Internal public interface SpacePermissionQueryBuilder
A centralised place for construction of database query conditions to filter or join on the "spacepermissions" table. This could be extended to support query languages other than HQL in future.
  • Method Details

    • getHqlPermissionFilterString

      String getHqlPermissionFilterString(String spacePermissionTableAlias)
      Creates an HQL string of conditions / filter to add to the "WHERE" clause of an HQL query, filtering down to SpacePermission rows which match / grant access to the user. Note: substituteHqlQueryParameters(org.hibernate.query.Query) MUST be called subsequently, to substitute in the required parameters.
      Parameters:
      spacePermissionTableAlias - alias of the SpacePermission table being queried
      Returns:
      an HQL string of conditions, to be appended as part of the "WHERE" clause
    • substituteHqlQueryParameters

      void substituteHqlQueryParameters(org.hibernate.query.Query query)
      Substitutes values into the parameters added by getHqlPermissionFilterString(java.lang.String)
      Parameters:
      query - the full HQL query, containing the contents of a previous call to getHqlPermissionFilterString(java.lang.String) (as well as other SQL clauses added elsewhere)
    • getUser

      @Nullable ConfluenceUser getUser()
      Returns the user this query builder was constructed for. Will be null for anonymous.
    • getPermissionType

      default String getPermissionType()
      Returns:
      permission type
      Since:
      7.11.0