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 voidApply row-security constraints to the given entity prior to persistence.org.springframework.data.jpa.domain.Specification<T> Returns a JPASpecificationthat restricts which rows are visible for the current user.default com.querydsl.core.types.PredicateReturns a QueryDSLPredicatethat restricts which rows are visible for the current user.
-
Method Details
-
rowFilterPredicate
default com.querydsl.core.types.Predicate rowFilterPredicate()Returns a QueryDSLPredicatethat restricts which rows are visible for the current user.- Returns:
- a QueryDSL
Predicaterestricting which rows are visible for the current user
-
rowFilter
org.springframework.data.jpa.domain.Specification<T> rowFilter()Returns a JPASpecificationthat restricts which rows are visible for the current user.- Returns:
- a JPA
Specificationrestricting 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
-