Class UserSelection
java.lang.Object
org.springframework.data.neo4j.core.UserSelection
This is a value object for a Neo4j user, potentially different from the user owning the
physical Neo4j connection. To make use of this a minimum version of Neo4j 4.4 and
Neo4j-Java-Driver 4.4 is required, otherwise any usage of
impersonate(String) together with either the
UserSelectionProvider or the ReactiveUserSelectionProvider will lead to
runtime errors.
Similar usage pattern like with the dynamic database selection are possible, for
example tying a UserSelectionProvider into Spring Security and use the current
user as a user to impersonate.
- Since:
- 6.2
- Author:
- Michael J. Simons
-
Method Summary
Modifier and TypeMethodDescriptionstatic UserSelectionJust use the connected user.boolean@Nullable StringgetValue()inthashCode()static UserSelectionimpersonate(String value) Impersonate another user.
-
Method Details
-
connectedUser
Just use the connected user.- Returns:
- a user selection that will just use the user owning the physical connection.
-
impersonate
Impersonate another user.- Parameters:
value- the name of the user to impersonate- Returns:
- a user selection representing an impersonated user.
-
getValue
-
equals
-
hashCode
-