Permissions Interface version v1
http://github.com/org/folio/mod-auth/_tenantPermissions
tenant permissions API implementation
This API provides a callback point for Okapi when new permission sets are added to the tenant
/_/tenantpermissions
post
Load new permissionSets into the permission module when a module gets enabled for a tenant
post /_/tenantpermissions
Load new permissionSets into the permission module when a module gets enabled for a tenant
Body
Media type: application/json
Type: json
Content:
{
"$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",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Okapi Permission Object",
"description": "An individual permission from an Okapi permission set",
"javaType": "org.folio.rest.jaxrs.model.OkapiPermission",
"properties": {
"permissionName": {
"description": "The unique permission name",
"type": "string"
},
"replaces": {
"description": "previously used names for this permission",
"type": "array",
"items": {
"type": "string"
}
},
"displayName": {
"description": "The human-readable name",
"type": "string"
},
"description": {
"description": "Description of the permission",
"type": "string"
},
"subPermissions": {
"description": "A list of child permissions granted by this permission",
"type": "array",
"items": {
"type": "string"
}
},
"visible": {
"description": "Whether or not this permission is visible to users",
"type": "boolean"
}
},
"additionalProperties": false
}
}
},
"required": [
"moduleId"
]
}
Example:
{
"moduleId": "sample-module",
"perms": [
{
"permissionName": "everything",
"displayName": "every possible permission",
"description": "All permissions combined",
"subPermissions": [
"sample.needed",
"sample.extra"
]
}
]
}
HTTP status code 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",
"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",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Okapi Permission Object",
"description": "An individual permission from an Okapi permission set",
"javaType": "org.folio.rest.jaxrs.model.OkapiPermission",
"properties": {
"permissionName": {
"description": "The unique permission name",
"type": "string"
},
"replaces": {
"description": "previously used names for this permission",
"type": "array",
"items": {
"type": "string"
}
},
"displayName": {
"description": "The human-readable name",
"type": "string"
},
"description": {
"description": "Description of the permission",
"type": "string"
},
"subPermissions": {
"description": "A list of child permissions granted by this permission",
"type": "array",
"items": {
"type": "string"
}
},
"visible": {
"description": "Whether or not this permission is visible to users",
"type": "boolean"
}
},
"additionalProperties": false
}
}
},
"required": [
"moduleId"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
Example:
Bad request
HTTP status code 422
Validation errors
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "errors.schema",
"description": "A set of errors",
"type": "object",
"properties": {
"errors": {
"description": "List of errors",
"id": "errors",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "error.schema",
"description": "An error",
"properties": {
"message": {
"type": "string",
"description": "Error message text"
},
"type": {
"type": "string",
"description": "Error message type"
},
"code": {
"type": "string",
"description": "Error message code"
},
"parameters": {
"description": "Error message parameters",
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "parameters.schema",
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
},
"required": [
"message"
]
}
},
"total_records": {
"description": "Total number of errors",
"type": "integer"
}
}
}
Example:
{
"errors": [
{
"message": "may not be null",
"type": "1",
"code": "-1",
"parameters": [
{
"key": "moduleTo",
"value": "null"
}
]
}
]
}
HTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Example:
Error