Class TLfnUserRepository

java.lang.Object
com.luciad.fusion.platform.repository.TLfnUserRepository

public class TLfnUserRepository extends Object

Repository to query the user that is currently logged in to LuciadFusion Studio. See currentUser().

LuciadFusion will create an implementation of the TLfnUserRepository at startup and provide this as a bean in the Spring container. Spring dependency injection can be used to obtain a reference to the repository in your code. The most straightforward way is to use the org.springframework.beans.factory.annotation.Autowired annotation in the constructor of your Spring component.


   @Controller
    public class MyController {

       private final TLfnUserRepository fUserRepository;

      @Autowired
       public MyController(TLfnUserRepository aUserRepository) {
         fUserRepository = aUserRepository;
       }
     }
  

Since:
2022.1
See Also:
  • Method Details

    • currentUser

      public Optional<TLfnUser> currentUser()
      Find the current user that is performing the action of the current thread.

      If no such user can be found (meaning there is no user logged in), an empty optional will be returned.

      Returns:
      an Optional containing the TLfnUser object of the current user, or an empty Optional if no such user can be found