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

# Server Permissions

> Use the experimental Laravel Copilot SDK ServerRpc permissions.extensionApprovals API to grant, list and revoke approvals for plugin extensions.

## Server Permissions

Scope: ServerRpc (server-wide operations tied to the Client)

For an overview of RPC and the list of all RPC pages, see [RPC](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc.md).

## Extension approvals (experimental)

`permissions()->extensionApprovals()` stores, lists and revokes per-user approvals for the extensions of installed plugins. This API is experimental and may change or be removed in the future. A stored approval applies to a later request when that request's capabilities are a subset of the approved capabilities.

### Approve a pending request

Pass `grant()` the ID of the session that owns the pending extension permission request and the ID of that request. Call it **before** the host handles the request as usual. `granted` tells you whether the request was eligible and the approval was stored. On success, `approval` holds the stored approval.

`grant()` only stores the approval. It does not respond to the pending request. The host still has to respond to the request in the usual way. For how to respond, see [Tools, permissions, commands, and UI](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc/session-tools.md).

```php theme={null}
use Revolution\Copilot\Facades\Copilot;
use Revolution\Copilot\Types\Rpc\PermissionsExtensionApprovalsGrantParams;

// permissions.extensionApprovals.grant
// Get $sessionId and $requestId from the pending extension permission request
$approvals = Copilot::client()->rpc()->permissions()->extensionApprovals();
$result = $approvals->grant(new PermissionsExtensionApprovalsGrantParams(
    sessionId: $sessionId,
    requestId: $requestId,
));

// $result->granted, $result->approval
```

### List and revoke

When you omit `sessionId` for `list()` and `revoke()`, or pass `null`, they target the server's settings profile. When you pass the ID of a connected session, they target that session's settings profile. This does not limit the approval to that session only.

```php theme={null}
use Revolution\Copilot\Types\Rpc\PermissionsExtensionApprovalsListParams;
use Revolution\Copilot\Types\Rpc\PermissionsExtensionApprovalsRevokeParams;

// permissions.extensionApprovals.list
$serverApprovals = $approvals->list();
$sessionApprovals = $approvals->list(new PermissionsExtensionApprovalsListParams(
    sessionId: $sessionId,
));

foreach ($sessionApprovals->approvals as $approval) {
    // $approval->extensionName, $approval->pluginName, $approval->capabilities
    // $approval->grantedAt, $approval->installationKey, $approval->installationLabel
}
```

When the user explicitly selects an approval to revoke, take it from that list or from the `approval` in a `grant()` result, and revoke it with the same settings profile.

```php theme={null}
// permissions.extensionApprovals.revoke
// $selectedApproval is the approval the user explicitly selected
$result = $approvals->revoke(new PermissionsExtensionApprovalsRevokeParams(
    extensionName: $selectedApproval->extensionName,
    installationKey: $selectedApproval->installationKey,
    sessionId: $sessionId,
));

// $result->revoked tells you whether a matching approval existed and was removed
```

`installationKey` is an opaque installation identifier. When you revoke, pass the value from the list or the grant result unchanged. You can also pass the arguments as an array.


## Related topics

- [ServerRpc overview](https://kawax.biz/en/packages/laravel-copilot-sdk/rpc/server-overview.md)
- [Deployment](https://kawax.biz/en/deployment.md)
- [Laravel MCP](https://kawax.biz/en/mcp.md)
- [GitHub Copilot SDK for Laravel](https://kawax.biz/en/packages/laravel-copilot-sdk/index.md)
- [Socialite for Discord](https://kawax.biz/en/packages/socialite-discord.md)


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