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

# Administrative

> Manage roles, recovery, wallet lifecycle, and subaccounts.

## Introduction

Administrative permissions delegate specific changes to wallet access and lifecycle.

* **Use when:** a signer needs to administer wallet access or perform a specific management operation.
* **For:** owners, trusted administrators, and guardians.

## How it works

1. Choose the operation the signer needs to perform.
2. Grant its specific permission, scoped to a role or subaccount where supported.
3. Use that role to authorize the corresponding transaction.
4. Confirm the transaction and refetch the resulting wallet state.

## Role and wallet management

| Permission | SDK builder | Capability |
| - | - | - |
| `All` | `all()` | Broad owner access to spending, execution, and role management |
| `AllButManageAuthority` | `allButManageAuthority()` | Broad execution access without authority and subaccount management |
| `ManageAuthority` | `manageAuthority()` | Add, remove, and update roles |
| `ReplaceAuthority` | `replaceAuthority({ roleId })` | Replace one role's signer while keeping its type and permissions |
| `CloseSwigAuthority` | `closeSwigAuthority()` | Authorize wallet and token-account closure, subject to lifecycle restrictions |

* `ManageAuthority` lets its holder grant access to others; reserve it for trusted administrators.
* `ReplaceAuthority` gives a guardian control over the replacement key for its target role.
* Active holds constrain role removal, guardian replacement, and wallet closure.

## Subaccount management

| Permission | SDK builder | Capability |
| - | - | - |
| `SubAccountV2Create` | `subAccountV2Create()` | Create V2 subaccounts |
| `SubAccountV2All` | `subAccountV2All({ subAccountId })` | Sign, withdraw, and toggle one V2 subaccount |
| `SubAccountV2Sign` | `subAccountV2Sign({ subAccountId })` | Sign as one V2 subaccount |
| `SubAccountV2Withdraw` | `subAccountV2Withdraw({ subAccountId })` | Withdraw from one V2 subaccount |
| `SubAccountV2Toggle` | `subAccountV2Toggle({ subAccountId })` | Enable or disable one V2 subaccount |
| `SubAccount` | `subAccount()` | Legacy V1 subaccount control |

Use builders compatible with the wallet's subaccount version. Reserved wallets
use V2 subaccounts; Classic's legacy V1 subaccount helpers cannot operate them.
The V2 permission constructors above do not turn those V1 operation helpers
into V2 builders; use the Rust V2 APIs for that flow.

## SDK example

A role administrator.

```typescript theme={null}
import { Actions } from "@swig-wallet/classic";

const actions = Actions.set().manageAuthority().get();
```

* Attach this permission set with [Add a role](https://build.onswig.com/solana/add-role.md).
* The role can manage access; this action alone does not grant a spending budget.
* For narrower delegation, use the [guardian recovery](https://build.onswig.com/solana/use-cases/recovery.md) example.


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