Interface RowSecurityHandler<T>

Type Parameters:
T - entity type
All Known Implementing Classes:
OwnerBasedRowSecurity

public interface RowSecurityHandler<T>
Provides a row-level security filter for entities of type T.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    apply(T entity)
    Apply row-security constraints to the given entity prior to persistence.
    org.springframework.data.jpa.domain.Specification<T>
    Returns a JPA Specification that restricts which rows are visible for the current user.
    default com.querydsl.core.types.Predicate
    Returns a QueryDSL Predicate that restricts which rows are visible for the current user.
  • Method Details

    • rowFilterPredicate

      default com.querydsl.core.types.Predicate rowFilterPredicate()
      Returns a QueryDSL Predicate that restricts which rows are visible for the current user.
      Returns:
      a QueryDSL Predicate restricting which rows are visible for the current user
    • rowFilter

      org.springframework.data.jpa.domain.Specification<T> rowFilter()
      Returns a JPA Specification that restricts which rows are visible for the current user.
      Returns:
      a JPA Specification restricting which rows are visible for the current user
    • apply

      default void apply(T entity)
      Apply row-security constraints to the given entity prior to persistence. Implementations may mutate the entity (e.g. set an owner) or throw an AccessDeniedException when the current user is not permitted to operate on it.
      Parameters:
      entity - the entity to check or mutate