# ISkillScriptGrantStore

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.iskillscriptgrantstore/
> Summary: ISkillScriptGrantStore: The store for skill script execution grants.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

The store for skill script execution grants.

```csharp
public interface ISkillScriptGrantStore
```

## Remarks

**Tenant behavior — EXPECTED tenant, uniformly, with no ambient
fallback.** Every member takes `tenantId` as an explicit
parameter; an implementation does not read `ITenantContext` at all.
This differs from the neighboring [IAgentDefinitionStore](/api/tracon.iagentdefinitionstore/),
which reads the ambient tenant internally instead — see that interface's
remarks for why the shape is not uniform across the cluster.

## Methods

### <a id="Tracon_ISkillScriptGrantStore_FindActiveAsync_System_String_System_String_System_String_System_DateTimeOffset_System_Threading_CancellationToken_"></a> FindActiveAsync\(string, string, string, DateTimeOffset, CancellationToken\)

Finds the active grant for the given script.

```csharp
ValueTask<SkillScriptGrant?> FindActiveAsync(string tenantId, string skillName, string scriptName, DateTimeOffset instant, CancellationToken cancellationToken = default)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant identifier.

`skillName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The skill name.

`scriptName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The script name.

`instant` [DateTimeOffset](https://learn.microsoft.com/dotnet/api/system.datetimeoffset)

The moment to check validity at.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[SkillScriptGrant](/api/tracon.skillscriptgrant/)?\>

The script-specific grant first, or the skill-wide grant otherwise.
[null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) if no active grant exists.

### <a id="Tracon_ISkillScriptGrantStore_GrantAsync_Tracon_SkillScriptGrant_System_Threading_CancellationToken_"></a> GrantAsync\(SkillScriptGrant, CancellationToken\)

Grants access, or updates an existing grant.

```csharp
ValueTask<SkillScriptGrant> GrantAsync(SkillScriptGrant grant, CancellationToken cancellationToken = default)
```

#### Parameters

`grant` [SkillScriptGrant](/api/tracon.skillscriptgrant/)

The grant to save.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[SkillScriptGrant](/api/tracon.skillscriptgrant/)\>

The grant with its identifier and timestamp assigned.

### <a id="Tracon_ISkillScriptGrantStore_ListAsync_System_String_System_Threading_CancellationToken_"></a> ListAsync\(string, CancellationToken\)

Lists all of a tenant's grant records.

```csharp
ValueTask<IReadOnlyList<SkillScriptGrant>> ListAsync(string tenantId, CancellationToken cancellationToken = default)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant identifier.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist\-1)<[SkillScriptGrant](/api/tracon.skillscriptgrant/)\>\>

All grants, including revoked and expired records.

### <a id="Tracon_ISkillScriptGrantStore_RevokeAsync_System_String_System_String_System_String_System_Threading_CancellationToken_"></a> RevokeAsync\(string, string, string?, CancellationToken\)

Revokes a grant.

```csharp
ValueTask<bool> RevokeAsync(string tenantId, string skillName, string? scriptName, CancellationToken cancellationToken = default)
```

#### Parameters

`tenantId` [string](https://learn.microsoft.com/dotnet/api/system.string)

The tenant identifier.

`skillName` [string](https://learn.microsoft.com/dotnet/api/system.string)

The skill name.

`scriptName` [string](https://learn.microsoft.com/dotnet/api/system.string)?

The script name; [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) for the skill-wide grant.

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\>

[true](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) if an active grant was revoked.
