Function add_non_administrative_users

Source
fn add_non_administrative_users(
    nethsm: &NetHsm,
    admin_credentials: &AdminCredentials,
    users: &[UserMapping],
    user_credentials: &[FullCredentials],
) -> Result<(), Error>
Expand description

Sets up all system-wide, non-administrative users based on provided credentials.

§Note

It is assumed that the default R-Administrator and system-wide keys are already set up, before calling this function (see add_system_wide_admins and add_system_wide_keys, respectively).

This function uses the nethsm with the default R-Administrator and is guaranteed to do so when it finishes.

§Errors

Returns an error if

  • there are no matching credentials in user_credentials for a user in the list of all available system-wide, non-administrative users,
  • a user exists already, but its passphrase cannot be set,
  • a user does not yet exist and it cannot be added,
  • a user has a tag and deleting it fails,
  • or adding a tag to a user fails.