Function get_first_available_namespace_admin

Source
fn get_first_available_namespace_admin(
    nethsm: &NetHsm,
    admin_credentials: &AdminCredentials,
    available_users: &[UserId],
    namespace: &NamespaceId,
) -> Result<UserId, Error>
Expand description

Retrieves the first available user in the [Administrator][UserRole::Administrator] (N-Administrator) role in a namespace.

Derives a list of users in the [Administrator][UserRole::Administrator] role in namespace from available_users. Ensures that at least one of the users is available on the nethsm.

ยงErrors

Returns an error if

  • user information of an N-Administrator cannot be retrieved,
  • or no N-Administrator is available in the namespace.