Interface ViewResolver
public interface ViewResolver
View Resolvers provide a way that plugins can provide custom sources for looking up views.
Each resolvable view must also have a corresponding
Search
saved in the
database. The ViewResolver methods pertaining to search records must be implemented in order for runtime
operation of views to work correctly.
See https://github.com/Graylog2/graylog2-server/pull/12280 and
https://github.com/Graylog2/graylog2-server/pull/12287 for more information.-
Method Summary
Modifier and TypeMethodDescriptionboolean
canReadView
(String viewId, Predicate<String> permissionTester, BiPredicate<String, String> entityPermissionsTester) A method to return whether the current user is authorized to read the current resolved view and its related objects (such as the backingSearch
record).getBySearchId
(String searchId)
-
Method Details
-
get
-
getBySearchId
- Parameters:
searchId
- A search id.- Returns:
- the corresponding
ViewDTO
for supplied searchId.
-
getSearchIds
- Returns:
- A set of all search ids referenced by resolvable views.
The search ids must be returned to prevent the searches from being automatically deleted by periodically by
SearchesCleanUpJob
.
-
canReadView
boolean canReadView(String viewId, Predicate<String> permissionTester, BiPredicate<String, String> entityPermissionsTester) A method to return whether the current user is authorized to read the current resolved view and its related objects (such as the backingSearch
record). This method accepts two permissions tester predicates, to allow each implementation to perform any combination of permission checks needed.- Parameters:
viewId
- The id of the view.permissionTester
- A predicate, which tests a single string permission parameter. For example, is the user authorized to read a view based on having of a particular permission?entityPermissionsTester
- A bi-predicate which tests two parameters (the permission to test and the id of the entity). For example, is the user authorized to read a view based on having a particular permission and/or having access to a particular entity?
-