AuthenticationManager

Constructors

Link copied to clipboard
constructor(@NonNull context: Context, @NonNull webApiClient: WebApiClient)

Types

Link copied to clipboard
Listener notified when per-property roles are (re-)resolved on an online login response, so a host (MapstedCoreApi) can build and publish the active UserRoleAccess.

Properties

Link copied to clipboard
val ROLE_CACHE_TTL_MILLIS: Long = 86400000
Role cache time-to-live.

Functions

Link copied to clipboard
open fun clearCachedRoles()
Wipe cached roles + lock list + timestamp.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Cached access-locked property list if the role cache is still within ROLE_CACHE_TTL_MILLIS; empty list if expired or never cached.
Link copied to clipboard
Cached access-locked property list ignoring the role-cache TTL.
Link copied to clipboard
Cached roles if still within ROLE_CACHE_TTL_MILLIS; empty map if expired or never cached.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isLoggedIn(): Boolean
Link copied to clipboard
True if a cache exists AND (now - savedAt) <= ROLE_CACHE_TTL_MILLIS.
Link copied to clipboard
open fun login(@NonNull context: Context, @NonNull request: AuthLogin.Request, @Nullable callback: AuthLogin.Callback)
Link copied to clipboard
open fun onDestroy()
Link copied to clipboard
open fun saveAllowedProperties(@Nullable allowedProperties: List<Integer>)
Link copied to clipboard
open fun saveAllowedRoles(@NonNull propertyRoleMap: Map<Integer, String>)
Alias of saveCachedRoles.
Link copied to clipboard
Link copied to clipboard
open fun saveCachedPropertiesWithLock(@Nullable propertiesWithLock: List<Integer>)
Persist the access-locked property list alongside the role cache.
Link copied to clipboard
open fun saveCachedRoles(@NonNull propertyRoleMap: Map<Integer, String>)
Persist the user's allowed roles (propertyId -> accessRoleId) and stamp the TTL now.
Link copied to clipboard
Register (or clear, with null) the listener invoked on online login success after fresh roles are cached.
Link copied to clipboard
Inject the userRoleId -> accessRestrictionId resolution source.