Interface SupportUserLoginService

All Known Implementing Classes:
SupportUserLoginServiceImpl

public interface SupportUserLoginService
Logins of the support user (the User with support_user = true) that have all roles, like the support login via OpenID or the logins with a configured API key. These logins have no password, they authenticate in another way (SSO, API key).

Script listeners are disabled and the logic runs privileged.

  • Method Summary

    Modifier and Type
    Method
    Description
    createOrUpdateLogin(String username, Consumer<Entity> principalAdjuster)
    Creates a login with the given username or updates the existing one: it is linked to the support user, gets a business unit if required and is activated.
    void
    linkAllRoles(String username)
    Gives the login every role in the null business unit.
    void
    setRoles(String username, Set<String> roleUniqueIds)
    Like linkAllRoles(String), but only for the roles with the given unique ids, and the login loses every other role.
  • Method Details

    • createOrUpdateLogin

      Optional<Entity> createOrUpdateLogin(String username, Consumer<Entity> principalAdjuster)
      Creates a login with the given username or updates the existing one: it is linked to the support user, gets a business unit if required and is activated.
      Parameters:
      principalAdjuster - sets login specific fields, called in the same transaction before the defaults are set
      Returns:
      empty if there is no support user
    • linkAllRoles

      void linkAllRoles(String username)
      Gives the login every role in the null business unit. Business unit specific login roles are replaced.
    • setRoles

      void setRoles(String username, Set<String> roleUniqueIds)
      Like linkAllRoles(String), but only for the roles with the given unique ids, and the login loses every other role. Unknown roles are skipped with a warning.