User Access Management
Pre-requisite: The user has to be signed in to perform the following operations.
Get User with Access
To get the list of users with access, the following method can be called.
spaceId(required): The id of the space.
InstaVision.spaceServices.getUsers(
onSuccess = { users ->
// The list of users with access is returned
},
onError = { error ->
// The error object contains the error code and message
}
)
Update User Access
To update the user access, the following method can be called.
spaceId(required): The id of the space.spaceUserId(required): The id of the user.request(required): The updated user access information.
val request = SpaceInviteRequest(
role = Role.VIEWER.value, // The role can be VIEWER or OWNER
inviteeEmail = "test@exmaple.com", // The email of the user
deviceIds = listOf("deviceId1", "deviceId2") // The list of device ids to grant access to
)
InstaVision.spaceServices.updateUser(
spaceId = "spaceId",
spaceUserId = "spaceUserId",
request = request,
onSuccess = {
// The user access has been updated successfully
},
onError = {
// The error object contains the error code and message
}
)
Revoke User Access
To delete the user access, the following method can be called.
spaceId(required): The id of the space.spaceUserId(required): The id of the user.type(required): The type of Sharing.
InstaVision.spaceServices.deleteUser(
spaceId = "spaceId",
spaceUserId = "User Id",
type = SharingTypes.SPACE.value, // The type of Sharing can be SPACE or SECURITY
onSuccess = {
// The user access has been deleted successfully
},
onError = {
// The error object contains the error code and message
}
)