Permissions Interface (v1)

http://github.com/org/folio/mod-auth/_tenantPermissions

Table of contents

tenant permissions API implementation

This API provides a callback point for Okapi when new permission sets are added to the tenant

/_/tenantpermissions

GET /_/tenantpermissions

Dummy get endpoint

GET /_/tenantpermissions
Body

Media type: text/plain

Type: any

Example:

Blah

Response 200

Body

Media type: text/plain

Type: any

Example:

Blah

POST /_/tenantpermissions

Load new permissionSets into the permission module when a module gets enabled for a tenant

POST /_/tenantpermissions
Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Okapi Permissions Set",
  "type": "object",
  "properties": {
    "moduleId": {
      "type": "string"
    },
    "perms": {
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "okapiPermission.json"
      }
    }
  }
}

Example:

{
  "moduleId": "sample-module",
  "perms": [
    {
      "permissionName": "everything",
      "displayName": "every possible permission",
      "description": "All permissions combined",
      "subPermissions": [
        "sample.needed",
        "sample.extra"
      ]
    }
  ]
}

Response 201

Permissions loaded successfully

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Okapi Permissions Set",
  "type": "object",
  "properties": {
    "moduleId": {
      "type": "string"
    },
    "perms": {
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "okapiPermission.json"
      }
    }
  }
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Example:

Bad request

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "errors": {
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "error.schema"
      }
    },
    "total_records": {
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Error