IamUtil.updateUserRoleAsync() Overload 1
DESCRIPTION
Asynchronously update an IAM user’s role on device.
The specified AsyncIamResultReceiver closure is invoked with IamError.OK upon successful completion or with an error if an error occurs. See the updateUserRole() function for details about possible error codes and known issues.
DECLARATION
static public func updateUserRoleAsync(connection: Connection,
                                           username: String,
                                           role: String,
                                           closure: @escaping AsyncIamResultReceiver)
PARAMETERS
- connection:
- An established connection to the device
- username:
- Username for the user that should have password updated
- role:
- New role for the user
- closure:
- Invoked when the user is deleted or an error occurs
Overload 2
DESCRIPTION
Asynchronously update an IAM user’s role on device.
Uses Swift concurrency and is therefore only available on iOS 13 and above.
DECLARATION
static public func updateUserRoleAsync(connection: Connection,
                                      username: String,
                                      role: String) async 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
THROWS 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:SetUserRoleaction is not allowed for the requesting role for theIAM:Usernameuser)
- IAM_NOT_SUPPORTED:
- if Nabto Edge IAM is not supported by the device