permission.denied

Signed in, but not allowed to do this

Profile

Raised with

Status

403

Message

yours

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"
}

Choosing between neighbours

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

  • If it is

    Use

  • Signed in, but not allowed to do this

    permission.denied this page
  • Hiding that the thing exists at all

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

    rather than auth.required
    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.

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.' },
},