---
title: "Permissions hooks"
description: "Hand-written shim. Generated CRUD hooks via ./permissions.gen.
useGrantPermission + useRevokePermission stay hand-written."
section: "Libraries"
group: "React hooks"
order: 440
---

## Hooks

### `useGrantPermission` `composite`

```ts
useGrantPermission(options?: MutationOpts<Permission, GrantPermissionParams>)
```

**Types:** [Permission](/types/permission) · [GrantPermissionParams](/types/grant-permission-params)

### `useListPermissions` `query`

List permissions.

```ts
useListPermissions(params?: Omit<ListPermissionsParams, | > & { filter?: PermissionFilter; orderBy?: PermissionOrderBy[]; } & PermissionShorthands, options?: QueryOpts<Page<Permission>>)
```

**Types:** [ListPermissionsParams](/types/list-permissions-params) · [PermissionFilter](/types/permission-filter) · [PermissionOrderBy](/types/permission-order-by) · [PermissionShorthands](/types/permission-shorthands) · [Page](/types/page) · [Permission](/types/permission)

### `usePurgePermission` `composite`

Permanently delete a revoked permission.

```ts
usePurgePermission(options?: MutationOpts<SuccessResponse, PurgePermissionParams>)
```

**Types:** [SuccessResponse](/types/success-response) · [PurgePermissionParams](/types/purge-permission-params)

### `useRestorePermission` `composite`

Restore a soft-deleted permission.

```ts
useRestorePermission(options?: MutationOpts<Permission, string>)
```

**Types:** [Permission](/types/permission)

### `useRetrievePermission` `query`

Get a permission by ID.

```ts
useRetrievePermission(id: string, options?: QueryOpts<Permission>)
```

**Types:** [Permission](/types/permission)

### `useRevokePermission` `composite`

```ts
useRevokePermission(options?: MutationOpts<SuccessResponse, string>)
```

**Types:** [SuccessResponse](/types/success-response)

### `useUpdatePermission` `mutation`

Update a permission.

```ts
useUpdatePermission(options?: MutationOpts<Permission, UpdatePermissionParams>)
```

**Types:** [Permission](/types/permission) · [UpdatePermissionParams](/types/update-permission-params)
