Function add_namespaced_non_administrative_users

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

Sets up all namespaced non-administrative users.

§Note

It is assumed that N-Administrators and namespaced keys are already set up, before calling this function (see add_namespace_admins and add_namespaced_keys, respectively).

This function uses the nethsm with the default R-Administrator, but may switch to a namespace-specific N-Administrator for individual operations. If this function succeeds, the nethsm is guaranteed to use the default R-Administrator again. If this function fails, the nethsm may still use a namespace-specific N-Administrator.

§Errors

Returns an error if

  • a namespaced user is not in a namespace,
  • the namespace of a user does not exist,
  • the namespace of a user exists, but no usable N-Administrator for it is known,
  • there are no matching credentials in user_credentials for a user in the list of all,
  • a user exists already, but its passphrase cannot be set,
  • a user does not yet exist and cannot be created,
  • a tag cannot be removed from a user,
  • or a tag cannot be added to a user.