Skip to main content

Get logged in user

The getLoggedInUserWithRights function is used to fetch the current logged in user with its member rights. It provides information about the user and its rights in the community.

Steps to get logged in user

  1. Call getLoggedInUserWithRights() function using the instance of LMFeedClient.
  2. Process the response (LMResponse<GetLoggedInUserWithRightsResponse>) as per your requirement.
CoroutineScope(Dispatchers.IO).launch {
// get response (LMResponse<GetLoggedInUserWithRightsResponse>)
val response = LMFeedClient.getLoggedInUserWithRights()
if (response.success) {
// process the logged in user response
processLoggedInUser()
} else {
// your function to process error message
processError(response.errorMessage)
}
}

Models

GetLoggedInUserWithRightsResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
userUserObjcet of the logged in user.
rightsList<ManagementRightPermissionData>Member Rights that are given to the user in the community.