Package io.jmix.multitenancy.core.impl
Class TenantProviderImpl
java.lang.Object
io.jmix.multitenancy.core.impl.TenantProviderImpl
- All Implemented Interfaces:
TenantProvider
@Component("mten_TenantProvider")
public class TenantProviderImpl
extends Object
implements TenantProvider
Implementation of
TenantProvider based on CurrentAuthentication.-
Field Summary
FieldsFields inherited from interface io.jmix.multitenancy.core.TenantProvider
NO_TENANT -
Constructor Summary
ConstructorsConstructorDescriptionTenantProviderImpl(CurrentAuthentication currentAuthentication, CurrentUserSubstitution currentUserSubstitution) -
Method Summary
Modifier and TypeMethodDescriptionReturns the tenant ID of a logged-in user.protected StringgetTenantIdFieldName(Class<?> clazz) getTenantIdForUser(org.springframework.security.core.userdetails.UserDetails userDetails) Returns tenant id for provided user, orTenantProvider.NO_TENANTconstant if tenant is currently not determined.
-
Field Details
-
fieldsCache
-
-
Constructor Details
-
TenantProviderImpl
public TenantProviderImpl(CurrentAuthentication currentAuthentication, CurrentUserSubstitution currentUserSubstitution)
-
-
Method Details
-
getCurrentUserTenantId
Returns the tenant ID of a logged-in user.- Specified by:
getCurrentUserTenantIdin interfaceTenantProvider- Returns:
- tenant ID of a logged-in user, 'no_tenant' if the user doesn't have a tenant ID
-
getTenantIdForUser
public String getTenantIdForUser(org.springframework.security.core.userdetails.UserDetails userDetails) Description copied from interface:TenantProviderReturns tenant id for provided user, orTenantProvider.NO_TENANTconstant if tenant is currently not determined.- Specified by:
getTenantIdForUserin interfaceTenantProvider- Parameters:
userDetails- user- Returns:
- tenant id
-
getTenantIdFieldName
-