Class AbstractRestUserRepository<T extends org.springframework.security.core.userdetails.UserDetails>

java.lang.Object
io.jmix.restds.auth.AbstractRestUserRepository<T>
Type Parameters:
T - type of entity representing users
All Implemented Interfaces:
UserRepository, org.springframework.security.core.userdetails.UserDetailsService

public abstract class AbstractRestUserRepository<T extends org.springframework.security.core.userdetails.UserDetails> extends Object implements UserRepository
Base implementation of UserRepository that loads users from the REST DataStore. The type of entity representing users is specified in the getUserClass() method.
  • Field Details

    • applicationContext

      @Autowired protected org.springframework.context.ApplicationContext applicationContext
    • metadata

      @Autowired protected Metadata metadata
    • dataManager

      @Autowired protected UnconstrainedDataManager dataManager
    • roleGrantedAuthorityUtils

      @Autowired protected RoleGrantedAuthorityUtils roleGrantedAuthorityUtils
    • resourceRoleRepository

      @Autowired protected ResourceRoleRepository resourceRoleRepository
    • rowLevelRoleRepository

      @Autowired protected RowLevelRoleRepository rowLevelRoleRepository
  • Constructor Details

    • AbstractRestUserRepository

      public AbstractRestUserRepository()
  • Method Details

    • getSystemUser

      public org.springframework.security.core.userdetails.UserDetails getSystemUser()
      Description copied from interface: UserRepository
      Returns the built-in 'system' user.
      Specified by:
      getSystemUser in interface UserRepository
    • getAnonymousUser

      public org.springframework.security.core.userdetails.UserDetails getAnonymousUser()
      Description copied from interface: UserRepository
      Returns the built-in 'anonymous' user.
      Specified by:
      getAnonymousUser in interface UserRepository
    • getByUsernameLike

      public List<? extends org.springframework.security.core.userdetails.UserDetails> getByUsernameLike(String substring)
      Description copied from interface: UserRepository
      Returns the list of users whose username contains the given substring.
      Specified by:
      getByUsernameLike in interface UserRepository
    • loadUserByUsername

      public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException
      Specified by:
      loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException
    • createAuthorities

      protected Collection<? extends org.springframework.security.core.GrantedAuthority> createAuthorities(RestInvoker restInvoker)
    • createAuthority

      protected org.springframework.security.core.GrantedAuthority createAuthority(String role)
    • getUserClass

      protected abstract Class<T> getUserClass()
      Returns the class of an entity representing users in the application.
    • createSystemUser

      protected T createSystemUser()
      Creates the built-in 'system' user.
    • initSystemUser

      protected void initSystemUser(T systemUser)
      Initializes the built-in 'system' user. Override in the application to grant authorities or initialize attributes.
    • createAnonymousUser

      protected T createAnonymousUser()
      Creates the built-in 'anonymous' user.
    • initAnonymousUser

      protected void initAnonymousUser(T anonymousUser)
      Initializes the built-in 'anonymous' user. Override in the application to grant authorities or initialize attributes.
    • getGrantedAuthoritiesBuilder

      protected AbstractRestUserRepository<T>.GrantedAuthoritiesBuilder getGrantedAuthoritiesBuilder()