Annotation Type PostFilter


@Retention(CLASS) @Target(METHOD) public @interface PostFilter

Removes the elements of the returned Collection or array for which the expression is false, with filterObject bound to each element, as Spring Security's annotation of the same name does.

@PostFilter("hasPermission(filterObject, 'read')")
public List<Document> all() { ... }

A returned collection is filtered in place through its iterator, so it must be modifiable; an array is replaced by a shorter copy. A Map or a stream is not filtered: the build refuses it.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The expression, evaluated once per element.
  • Element Details

    • value

      String value
      The expression, evaluated once per element.