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 TypeMethodDescriptiondefault void
Apply row-security constraints to the given entity prior to persistence.org.springframework.data.jpa.domain.Specification
<T> Returns a JPASpecification
that restricts which rows are visible for the current user.default com.querydsl.core.types.Predicate
Returns a QueryDSLPredicate
that restricts which rows are visible for the current user.
-
Method Details
-
rowFilterPredicate
default com.querydsl.core.types.Predicate rowFilterPredicate()Returns a QueryDSLPredicate
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 JPASpecification
that restricts which rows are visible for the current user.- Returns:
- a JPA
Specification
restricting which rows are visible for the current user
-
apply
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
-