> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Struct ViewPrivateOptions

Module: `noir_aztec::test::helpers::test_environment`

```rust
pub struct ViewPrivateOptions<let S: u32, let T: u32>
{ /* private fields */ }
```

Configuration for [`TestEnvironment::view_private_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#view_private_opts).

Constructed by calling [`ViewPrivateOptions::new`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.ViewPrivateOptions.md#new) and then chaining methods setting each value:

```rust
env.view_private_opts(from, ViewPrivateOptions::new().with_additional_scopes([other]), call);
```

## Implementations

```rust
impl ViewPrivateOptions<0, 0>
```

```rust
pub fn new() -> Self
```

Creates default `ViewPrivateOptions`.

The default values are the same as if using [`TestEnvironment::view_private`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#view_private) instead of [`TestEnvironment::view_private_opts`](/aztec-nr-api/v6.0.0/noir_aztec/test/helpers/test_environment/struct.TestEnvironment.md#view_private_opts).

```rust
impl<let S: u32, let T: u32> ViewPrivateOptions<S, T>
```

```rust
pub fn with_additional_scopes<let S2: u32>(
    self,
    additional_scopes: [AztecAddress; S2],
) -> ViewPrivateOptions<S2, T>
```

Grants access to secrets of additional accounts.

By default only the secrets that belong to the `from` account can be accessed: this function lets contracts retrieve private information from other accounts during execution.

Example usage includes accounts querying an escrow's balance, which may require accessing the escrow's own notes.

```rust
pub fn with_authorized_utility_call_targets<let T_2: u32>(
    self,
    targets: [AztecAddress; T_2],
) -> ViewPrivateOptions<S, T_2>
```

Authorizes cross-contract utility calls to given targets.

By default, cross-contract utility calls are denied. This method lets the test author specify which target contracts are allowed to be called via utility functions during execution.
