Api

Create a new permission

post/permissions

Request body

namestring required

Name of the permission to add

filestring required

Filename of the permission to add

descriptionstring

Description of the permission to add

codestring

Middleware function

Example request

{
  "name": "Connected User",
  "file": "connected-user",
  "description": "Only connected user are allowed",
  "code": "module.exports = (req, res, next) => { if (req.user) { return next(); } return next(new Error('Unauthorized');}"
}

Response

Success

Changes

No recorded changes to this endpoint across all 6 revisions of this API.