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

See https://docs.nabto.com/developer/guides/concepts/iam/intro.html for an intro to the concept of roles.

DECLARATION

    static public func updateUserRole(connection: Connection,
                                      username: String,
                                      role: String) throws 

PARAMETERS

connection:
An established connection to the device
username:
Username for the user that should have password updated
role:
New role for the user

ERRORS

Throws the following errors:

USER_DOES_NOT_EXIST:
if the specified user does not exist on the device (see note above)
ROLE_DOES_NOT_EXIST:
the specified role does not exist in the device IAM configuration (see note above)
BLOCKED_BY_DEVICE_CONFIGURATION:
if the device configuration does not allow the current user to update the specified user's role (the `IAM:SetUserRole` action is not allowed for the requesting role for the `IAM:Username` user)
IAM_NOT_SUPPORTED:
if Nabto Edge IAM is not supported by the device

RETURN VALUES

None.

EXAMPLES

None.