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
- Call
getLoggedInUserWithRights()
function using the instance ofLMFeedClient
. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
user | User | Objcet of the logged in user. | |
rights | List<ManagementRightPermissionData> | Member Rights that are given to the user in the community. |