foliolib.folio.api.permissions.TenantPermissions

class foliolib.folio.api.permissions.TenantPermissions(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

tenant permissions API implementation

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

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

set_tenantpermission(tenantpermission)

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

set_tenantpermission(tenantpermission: dict)

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

POST /_/tenantpermissions

Parameters

tenantpermission (dict) – See Schema below

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Okapi Permissions Set",
  "type": "object",
  "description": "A set of permissions populated by Okapi",
  "properties": {
    "moduleId": {
      "description": "The ID of the Okapi module that provides these permissions",
      "type": "string"
    },
    "replaces": {
      "description": "List of modules that this replaces",
      "type": "array",
      "items": {
        "description": "Module name",
        "type": "string"
      }
    },
    "perms": {
      "description": "A set of permissions",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "okapiPermission.json"
      }
    }
  },
  "required": [
    "moduleId"
  ]
}