IamUtil.updateUserRole()
DESCRIPTION
Update an IAM user’s role on device.
Known issue: This function currently assumes the user exists. To be able to interpret the ROLE_DOES_NOT_EXIST code correctly, this assumption most hold. Later it can gracefully handle non-existing users
This function blocks until it has succeeded.
See https://docs.nabto.com/developer/guides/iam/intro.html for an intro to the concept of roles.
DECLARATION
public abstract void updateUserRole(Connection connection, String username, String role)
PARAMETERS
connection:- An established connection to the device
username:- Username for the user that should have password updated
role:- New role for the user
THROWS EXCEPTIONS
IamException:- with IamError
USER_DOES_NOT_EXISTif the specified user does not exist on the device (see note above) IamException:- with IamError
ROLE_DOES_NOT_EXISTthe specified role does not exist in the device IAM configuration (see note above) IamException:- with IamError
BLOCKED_BY_DEVICE_CONFIGURATIONif the device configuration does not allow the current user to update the specified user's role (theIAM:SetUserRoleaction is not allowed for the requesting role for theIAM:Usernameuser) IamException:- with IamError
IAM_NOT_SUPPORTEDif Nabto Edge IAM is not supported by the device