> ## Documentation Index
> Fetch the complete documentation index at: https://klef.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GrantsByField

> The grants a principal read carries, by entitlement field.

```csharp
public sealed class GrantsByField
```

## Constructors

```csharp
public GrantsByField()
```

## Methods

### Add()

```csharp
public void Add(IReadOnlyDictionary<string, IReadOnlyList<Grant>>? grants)
```

#### Parameters

**grants** `IReadOnlyDictionary\<String,IReadOnlyList\<Grant\>\>` *required*

**Type:** `IReadOnlyDictionary<String,IReadOnlyList<Grant>>`

```csharp
public void Add(string field, IEnumerable<Grant> grants)
```

#### Parameters

**field** `string` *required*

**grants** `IEnumerable\<Grant\>` *required*

**Type:** `IEnumerable<Grant>`

### AddDirect()

```csharp
public void AddDirect(ConnectorManifest manifest, PrincipalRef holder, string field, IEnumerable<string> values)
```

Adds the values one holder holds directly on a field.

#### Parameters

**manifest** `ConnectorManifest` *required*

**holder** `PrincipalRef` *required*

**field** `string` *required*

**values** `IEnumerable\<string\>` *required*

### Clear()

```csharp
public void Clear()
```

### ToDictionary()

```csharp
public IReadOnlyDictionary<string, IReadOnlyList<Grant>> ToDictionary()
```

#### Returns

`IReadOnlyDictionary<String,IReadOnlyList<Grant>>`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.