# permission.denied

Signed in, but not allowed to do this

Profile: [Errors](https://www.prongs.dev/docs/intents/errors.md) · Raised with: [`fail()`](https://www.prongs.dev/docs/profiles/errors.md) · Status: `403` · Message: yours

## Example

```ts
return fail('permission.denied', 'Only the page owner can do that.');
```

The caller gets

```bash
HTTP 403

{
  "ok": false,
  "error": "Only the page owner can do that.",
  "code": "permission.denied"
}
```

## Choosing between neighbours

Find the row that describes your case, and use the intent on the right.

| If it is for… | Use |
|---|---|
| Signed in, but not allowed to do this | `permission.denied` (this page) |
| Hiding that the thing exists at all | [`record.missing`](https://www.prongs.dev/docs/intents/record/missing.md) |
| A signed-in caller who may not do this (rather than [`auth.required`](https://www.prongs.dev/docs/intents/auth/required.md)) | `permission.denied` (this page) |

## Connections

Declared in the registry, both directions. Where an intent is used in your own code is something check and the gallery see; this site has no app code.

- Built from: [`status.forbidden`](https://www.prongs.dev/docs/intents/errors.md#status-forbidden)

## For registry authors

**Starter intents.** These are the intents `prongs add errors` puts in your registry, raised with [`fail()`](https://www.prongs.dev/docs/profiles/errors.md). Change the messages to suit your app, and the statuses through the [`status.*`](https://www.prongs.dev/docs/intents/errors.md#status) intents they are built from.

The entry `prongs add errors` writes into your registry. Change the message here, or the status through its [`status.*`](https://www.prongs.dev/docs/intents/errors.md#status) ref.

```ts
'permission.denied': {
  kind: 'semantic',
  description: 'Signed in, but not allowed to do this',
  refs: ['status.forbidden'],
  keywords: ['forbidden', 'not allowed', 'owner only', 'admin only'],
  notFor: [
    {
      context: 'hiding that the thing exists at all',
      instead: 'record.missing',
    },
  ],
  binding: { publicMessage: 'You can’t do that.' },
},
```
