prongs
GitHub

permission.denied

Signed in, but not allowed to do this

Profile

Raised with

Status

403

Message

yours
Read https://www.prongs.dev/docs/intents/permission/denied.md and tell me whether permission.denied fits what I am building.

Example

TS
return fail('permission.denied', 'Only the page owner can do that.');
The caller gets
Terminal
HTTP 403

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

Connections

Choosing between neighbours

  • If it is

    Use

  • Signed in, but not allowed to do this

    permission.denied
  • Hiding that the thing exists at all

    record.missing
  • A signed-in caller who may not do this

    rather than auth.required
    permission.denied

For registry authors

Starter intents. These are the intents prongs add errors puts in your registry, raised with fail(). Change the messages to suit your app, and the statuses through the 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.* 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.' },
},