foliolib.folio.api.rolesKeycloak.Roleskeycloak

class foliolib.folio.api.rolesKeycloak.Roleskeycloak(tenant: str)

Bases: foliolib.folio.FolioApi

Mod Roles Keycloak API

Mod Roles Keycloak API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

assignrolestouser(userRolesRequest)

Create a record associating role with user

createcapabilityset(capabilitySet)

Create a capability set

createcapabilitysets(capabilitySets)

Create one or more capability sets

createpolicies(policiesRequest)

Create one or more policies

createpolicy(policy)

Create a policy

createrole(role)

Create a role

createrolecapabilities(roleCapabilitiesRequest)

Create a record associating one or more capabilities with the role

createrolecapabilitysets(...)

Create a record associating one or more capabilities with the role

createroles(rolesRequest)

Create one or more roles

createusercapabilities(userCapabilitiesRequest)

Create a record associating one or more capabilities with a user.

createusercapabilitysets(...)

Create a record associating one or more capabilities with a user.

deletecapabilityset(id_)

Delete a capability set

deletepolicy(id_)

Delete a policy

deleterole(id_)

Delete a role

deleterolecapabilities(id_)

Removes all capabilities assignments for the specified role identifier

deleterolecapabilitysets(id_)

Removes all capability sets assignments for the specified role identifier

deleteusercapabilities(id_)

Removes all capability assignments for the specified user identifier

deleteusercapabilitysets(id_)

Removes all capability set assignments for the specified user identifier

deleteuserroles(id_)

Delete a roles user by user ID

findcapabilities(**kwargs)

Get capabilities by query

findcapabilitiesbycapabilitysetid(id_, **kwargs)

Find capabilities by capability set ID

findcapabilitiesbyroleid(id_, **kwargs)

Get capabilities assigned to role by role identifier

findcapabilitiesbyuserid(id_, **kwargs)

Retrieve capabilities assigned to role by role identifier

findcapabilitysets(**kwargs)

Get capabilities by query

findpolicies(**kwargs)

Get policies by query

findroles(**kwargs)

Get roles by query

finduserroles(**kwargs)

Search user-role relations by CQL query

getcapabilitybyid(id_)

Get capability by ID

getcapabilitysetbyid(id_)

Get capability set by ID

getcapabilitysetsbyroleid(id_, **kwargs)

Get capability sets assigned to role by role identifier

getcapabilitysetsbyuserid(id_, **kwargs)

Retrieve capability sets assigned to role by role identifier

getpermissionsuser(id_, **kwargs)

Get permissions by user ID

getpolicy(id_)

Get policy by ID

getrole(id_)

Get role by ID

getrolecapabilities(**kwargs)

Get role-capability relation items by CQL query and pagination parameters

getrolecapabilitysets(**kwargs)

Get role-capability-set relation items by CQL query

getusercapabilities(**kwargs)

Search user capabilities by CQL query

getusercapabilitysets(**kwargs)

Get user capabilities by CQL query and pagination parameters

getuserroles(id_)

Get roles user by user ID

migratepolicies()

Migrate user policies from mod-permission to keycloak

updatecapabilityset(capabilitySet, id_)

Update a capability set

updatepolicy(policy, id_)

Update a policy

updaterole(role, id_)

Update a role

updaterolecapabilities(...)

Modifies the set of capabilities assigned to the specified role.

updaterolecapabilitysets(...)

Modifies the set of capability sets assigned to the specified role.

updateusercapabilities(...)

Modifies the set of capabilities assigned to the specified user.

updateusercapabilitysets(...)

Modifies the set of capability sets assigned to the specified user.

updateuserroles(userRolesRequest, id_)

Update a roles user by user ID

assignrolestouser(userRolesRequest)

Create a record associating role with user

POST /roles/users

Parameters

userRolesRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "userRolesRequest.json",
    "title": "User-roles relation Batch Request Schema",
    "description": "User-roles request body",
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "format": "uuid",
            "description": "User identifier (UUID)"
        },
        "roleIds": {
            "type": "array",
            "description": "Role identifiers",
            "items": {
                "type": "string",
                "format": "uuid",
                "description": "Role identifier (UUID)"
            }
        }
    }
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "userRoles.json",
    "title": "List of User-Role Relation Items Schema",
    "description": "List of user-role relation items",
    "type": "object",
    "properties": {
        "userRoles": {
            "description": "List of user-role relation items",
            "type": "array",
            "items": {
                "$ref": "userRole.json"
            },
            "nullable": false
        },
        "totalRecords": {
            "description": "The total number of user-role relation items matching the provided criteria",
            "type": "integer"
        }
    }
}
createcapabilityset(capabilitySet)

Create a capability set

POST /capability-sets

Parameters

capabilitySet (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "Capability Set Object Schema",
    "description": "Object containing the details of the capability set",
    "properties": {
        "id": {
            "description": "A unique identifier for this capability",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "a human-readable name/label for this capability.  Takes the form of {resourceName}.{scope}, e.g. item.create",
            "type": "string",
            "readOnly": true
        },
        "description": {
            "description": "Free form description of the capability",
            "type": "string"
        },
        "resource": {
            "description": "The resource this capability is associated with, e.g. item",
            "type": "string",
            "pattern": "^[A-Za-z\\s]+$"
        },
        "action": {
            "$ref": "capabilityAction.json"
        },
        "applicationId": {
            "description": "The id of the application which defines the capability",
            "type": "string"
        },
        "type": {
            "$ref": "capabilityType.json"
        },
        "capabilities": {
            "description": "List with assigned capability ids",
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        },
        "metadata": {
            "$ref": "../common/metadata.json",
            "readOnly": true
        }
    },
    "required": [
        "resource",
        "action",
        "permissions",
        "type",
        "applicationId"
    ]
}
createcapabilitysets(capabilitySets)

Create one or more capability sets

POST /capability-sets/batch

Parameters

capabilitySets (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Sets Object Schema",
    "description": "Response body containing capability set records",
    "type": "object",
    "properties": {
        "capabilitySets": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capabilitySet.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
createpolicies(policiesRequest)

Create one or more policies

POST /policies/batch

Parameters

policiesRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "type": "object",
    "description": "A list of policies with additional meta information.",
    "properties": {
        "policies": {
            "description": "A list of policies.",
            "type": "array",
            "items": {
                "$ref": "policy.json"
            },
            "minItems": 1,
            "maxItems": 255
        }
    },
    "required": [
        "policies"
    ]
}
{
    "type": "object",
    "description": "A list of policies with additional meta information.",
    "properties": {
        "policies": {
            "description": "A list of policies.",
            "type": "array",
            "items": {
                "$ref": "policy.json"
            }
        },
        "totalRecords": {
            "description": "The total number of roles matching the provided criteria",
            "type": "integer"
        }
    }
}
createpolicy(policy)

Create a policy

POST /policies

Parameters

policy (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "type": "object",
    "description": "Object containing the details of the policy.",
    "properties": {
        "id": {
            "description": "A unique identifier for this policy. System-generated if not provided.",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this policy. Required.",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the policy. Optional.",
            "type": "string"
        },
        "type": {
            "$ref": "policyType.json"
        },
        "userPolicy": {
            "$ref": "userPolicy.json"
        },
        "timePolicy": {
            "$ref": "timePolicy.json"
        },
        "rolePolicy": {
            "$ref": "rolePolicy.json"
        },
        "metadata": {
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name",
        "type"
    ]
}
createrole(role)

Create a role

POST /roles

Parameters

role (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "role.json",
    "title": "Role schema",
    "description": "Role",
    "type": "object",
    "properties": {
        "id": {
            "description": "Role identifier",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this role",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the role",
            "type": "string"
        },
        "metadata": {
            "readOnly": true,
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name"
    ]
}
createrolecapabilities(roleCapabilitiesRequest)

Create a record associating one or more capabilities with the role

POST /roles/capabilities

Parameters

roleCapabilitiesRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-Capability Request Schema",
    "description": "Request body to assign existing capabilities to a role",
    "type": "object",
    "properties": {
        "roleId": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the role"
        },
        "capabilityIds": {
            "description": "List of capability identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            },
            "minItems": 1
        }
    },
    "required": [
        "roleId",
        "capabilityIds"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-Capabilities Objects Schema",
    "description": "Response body containing role-capabilities relations for search request",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of role-capability objects matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "roleCapabilities": {
            "description": "List with found/created role-capability relations",
            "type": "array",
            "items": {
                "$ref": "roleCapability.json"
            }
        }
    }
}
createrolecapabilitysets(roleCapabilitySetsRequest)

Create a record associating one or more capabilities with the role

POST /roles/capability-sets

Parameters

roleCapabilitySetsRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-CapabilitySet Request Schema",
    "description": "Request body to assign existing capability sets to a role",
    "type": "object",
    "properties": {
        "roleId": {
            "type": "string",
            "format": "uuid",
            "description": "ID of the role"
        },
        "capabilitySetIds": {
            "description": "List of capability set identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability set identifier",
                "format": "uuid"
            },
            "minItems": 1
        }
    },
    "required": [
        "roleId",
        "capabilitySetIds"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-Capability Set Objects Schema",
    "description": "Response body containing role-capabilitySet relations for search request",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of role-capability objects matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "roleCapabilitySets": {
            "description": "List with found/created role-capabilitySet relations",
            "type": "array",
            "items": {
                "$ref": "roleCapabilitySet.json"
            }
        }
    }
}
createroles(rolesRequest)

Create one or more roles

POST /roles/batch

Parameters

rolesRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "roles.json",
    "title": "Roles schema",
    "description": "Roles",
    "type": "object",
    "properties": {
        "roles": {
            "type": "array",
            "items": {
                "$ref": "role.json"
            },
            "minItems": 1,
            "maxItems": 255
        }
    },
    "required": [
        "roles"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "roles.json",
    "title": "Roles schema",
    "description": "Roles",
    "type": "object",
    "properties": {
        "roles": {
            "description": "Role identifier",
            "type": "array",
            "items": {
                "$ref": "role.json"
            },
            "nullable": false
        },
        "totalRecords": {
            "description": "The total number of roles matching the provided criteria",
            "type": "integer"
        }
    },
    "required": [
        "roles"
    ]
}
createusercapabilities(userCapabilitiesRequest)

Create a record associating one or more capabilities with a user.

POST /users/capabilities

Parameters

userCapabilitiesRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User-Capability Request Schema",
    "description": "Request body to assign existing capabilities to a user",
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "format": "uuid",
            "description": "User identifier"
        },
        "capabilityIds": {
            "description": "List of capability identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            },
            "minItems": 1
        }
    },
    "required": [
        "userId",
        "capabilityIds"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Capabilities Schema",
    "description": "User capabilities collection",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "userCapabilities": {
            "description": "List with found/created user-capability relations",
            "type": "array",
            "items": {
                "$ref": "userCapability.json"
            }
        }
    }
}
createusercapabilitysets(userCapabilitySetsRequest)

Create a record associating one or more capabilities with a user.

POST /users/capability-sets

Parameters

userCapabilitySetsRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User-CapabilitySet Request Schema",
    "description": "Request body to assign existing capability sets to a user",
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "format": "uuid",
            "description": "User identifier"
        },
        "capabilitySetIds": {
            "description": "List of capability identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability set identifier",
                "format": "uuid"
            },
            "minItems": 1
        }
    },
    "required": [
        "roleId",
        "capabilitySetIds"
    ]
}
{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Capability Set Schema",
    "description": "User capability set collection",
    "type": "object",
    "properties": {
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "userCapabilitySets": {
            "description": "List with found/created user-capabilitySet relations",
            "type": "array",
            "items": {
                "$ref": "userCapabilitySet.json"
            }
        }
    }
}
deletecapabilityset(id_)

Delete a capability set

DELETE /capability-sets/{id}

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deletepolicy(id_)

Delete a policy

DELETE /policies/{id}

deleterole(id_)

Delete a role

DELETE /roles/{id}

deleterolecapabilities(id_)

Removes all capabilities assignments for the specified role identifier

DELETE /roles/{id}/capabilities

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deleterolecapabilitysets(id_)

Removes all capability sets assignments for the specified role identifier

DELETE /roles/{id}/capability-sets

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deleteusercapabilities(id_)

Removes all capability assignments for the specified user identifier

DELETE /users/{id}/capabilities

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deleteusercapabilitysets(id_)

Removes all capability set assignments for the specified user identifier

DELETE /users/{id}/capability-sets

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

deleteuserroles(id_)

Delete a roles user by user ID

DELETE /roles/users/{id}

findcapabilities(**kwargs)

Get capabilities by query

GET /capabilities

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capabilities Object Schema",
    "description": "Response body containing capability records",
    "type": "object",
    "properties": {
        "capabilities": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capability.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
findcapabilitiesbycapabilitysetid(id_, **kwargs)

Find capabilities by capability set ID

GET /capability-sets/{id}/capabilities

Keyword Arguments
  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capabilities Object Schema",
    "description": "Response body containing capability records",
    "type": "object",
    "properties": {
        "capabilities": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capability.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
findcapabilitiesbyroleid(id_, **kwargs)

Get capabilities assigned to role by role identifier

GET /roles/{id}/capabilities

Keyword Arguments
  • expand (bool) – Defines if capability sets must be expanded (default: False)

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capabilities Object Schema",
    "description": "Response body containing capability records",
    "type": "object",
    "properties": {
        "capabilities": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capability.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
findcapabilitiesbyuserid(id_, **kwargs)

Retrieve capabilities assigned to role by role identifier

GET /users/{id}/capabilities

Keyword Arguments
  • expand (bool) – Defines if capability sets must be expanded (default: False)

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capabilities Object Schema",
    "description": "Response body containing capability records",
    "type": "object",
    "properties": {
        "capabilities": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capability.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
findcapabilitysets(**kwargs)

Get capabilities by query

GET /capability-sets

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Sets Object Schema",
    "description": "Response body containing capability set records",
    "type": "object",
    "properties": {
        "capabilitySets": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capabilitySet.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
findpolicies(**kwargs)

Get policies by query

GET /policies

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "type": "object",
    "description": "A list of policies with additional meta information.",
    "properties": {
        "policies": {
            "description": "A list of policies.",
            "type": "array",
            "items": {
                "$ref": "policy.json"
            }
        },
        "totalRecords": {
            "description": "The total number of roles matching the provided criteria",
            "type": "integer"
        }
    }
}
findroles(**kwargs)

Get roles by query

GET /roles

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "roles.json",
    "title": "Roles schema",
    "description": "Roles",
    "type": "object",
    "properties": {
        "roles": {
            "description": "Role identifier",
            "type": "array",
            "items": {
                "$ref": "role.json"
            },
            "nullable": false
        },
        "totalRecords": {
            "description": "The total number of roles matching the provided criteria",
            "type": "integer"
        }
    },
    "required": [
        "roles"
    ]
}
finduserroles(**kwargs)

Search user-role relations by CQL query

GET /roles/users

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "userRoles.json",
    "title": "List of User-Role Relation Items Schema",
    "description": "List of user-role relation items",
    "type": "object",
    "properties": {
        "userRoles": {
            "description": "List of user-role relation items",
            "type": "array",
            "items": {
                "$ref": "userRole.json"
            },
            "nullable": false
        },
        "totalRecords": {
            "description": "The total number of user-role relation items matching the provided criteria",
            "type": "integer"
        }
    }
}
getcapabilitybyid(id_)

Get capability by ID

GET /capabilities/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "Capability Set Object Schema",
    "description": "Object containing the details of the capability set",
    "properties": {
        "id": {
            "description": "A unique identifier for this capability",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "a human-readable name/label for this capability.  Takes the form of {resourceName}.{scope}, e.g. item.create",
            "type": "string",
            "readOnly": true
        },
        "description": {
            "description": "Free form description of the capability",
            "type": "string"
        },
        "resource": {
            "description": "The resource this capability is associated with, e.g. item",
            "type": "string",
            "pattern": "^[A-Za-z\\s]+$"
        },
        "action": {
            "$ref": "capabilityAction.json"
        },
        "applicationId": {
            "description": "The id of the application which defines the capability",
            "type": "string"
        },
        "permission": {
            "description": "Folio permission name",
            "type": "string"
        },
        "endpoints": {
            "type": "array",
            "description": "List of assigned endpoints",
            "items": {
                "$ref": "endpoint.json"
            }
        },
        "type": {
            "$ref": "capabilityType.json"
        },
        "metadata": {
            "$ref": "../common/metadata.json",
            "readOnly": true
        }
    },
    "required": [
        "resource",
        "action",
        "permissions",
        "type",
        "applicationId"
    ]
}
getcapabilitysetbyid(id_)

Get capability set by ID

GET /capability-sets/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "Capability Set Object Schema",
    "description": "Object containing the details of the capability set",
    "properties": {
        "id": {
            "description": "A unique identifier for this capability",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "a human-readable name/label for this capability.  Takes the form of {resourceName}.{scope}, e.g. item.create",
            "type": "string",
            "readOnly": true
        },
        "description": {
            "description": "Free form description of the capability",
            "type": "string"
        },
        "resource": {
            "description": "The resource this capability is associated with, e.g. item",
            "type": "string",
            "pattern": "^[A-Za-z\\s]+$"
        },
        "action": {
            "$ref": "capabilityAction.json"
        },
        "applicationId": {
            "description": "The id of the application which defines the capability",
            "type": "string"
        },
        "type": {
            "$ref": "capabilityType.json"
        },
        "capabilities": {
            "description": "List with assigned capability ids",
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        },
        "metadata": {
            "$ref": "../common/metadata.json",
            "readOnly": true
        }
    },
    "required": [
        "resource",
        "action",
        "permissions",
        "type",
        "applicationId"
    ]
}
getcapabilitysetsbyroleid(id_, **kwargs)

Get capability sets assigned to role by role identifier

GET /roles/{id}/capability-sets

Keyword Arguments
  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Sets Object Schema",
    "description": "Response body containing capability set records",
    "type": "object",
    "properties": {
        "capabilitySets": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capabilitySet.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
getcapabilitysetsbyuserid(id_, **kwargs)

Retrieve capability sets assigned to role by role identifier

GET /users/{id}/capability-sets

Keyword Arguments
  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Sets Object Schema",
    "description": "Response body containing capability set records",
    "type": "object",
    "properties": {
        "capabilitySets": {
            "description": "A collection of capability sets",
            "type": "array",
            "items": {
                "$ref": "capabilitySet.json"
            },
            "minItems": 1
        },
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        }
    },
    "required": [
        "capabilities"
    ]
}
getpermissionsuser(id_, **kwargs)

Get permissions by user ID

GET /permissions/users/{id}

Keyword Arguments

onlyVisible (bool) – Return only visible permission sets (default: False)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotImplemented – Operation is not supported error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Permissions User Schema",
    "description": "Permissions user",
    "type": "object",
    "properties": {
        "userId": {
            "description": "Id of the user",
            "type": "string",
            "format": "uuid"
        },
        "permissions": {
            "description": "List of permissions assigned to the user",
            "type": "array",
            "minItems": 1,
            "items": {
                "description": "Permission names assigned to the user",
                "type": "string"
            }
        }
    },
    "required": [
        "userId",
        "permissions"
    ]
}
getpolicy(id_)

Get policy by ID

GET /policies/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "type": "object",
    "description": "Object containing the details of the policy.",
    "properties": {
        "id": {
            "description": "A unique identifier for this policy. System-generated if not provided.",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this policy. Required.",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the policy. Optional.",
            "type": "string"
        },
        "type": {
            "$ref": "policyType.json"
        },
        "userPolicy": {
            "$ref": "userPolicy.json"
        },
        "timePolicy": {
            "$ref": "timePolicy.json"
        },
        "rolePolicy": {
            "$ref": "rolePolicy.json"
        },
        "metadata": {
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name",
        "type"
    ]
}
getrole(id_)

Get role by ID

GET /roles/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "role.json",
    "title": "Role schema",
    "description": "Role",
    "type": "object",
    "properties": {
        "id": {
            "description": "Role identifier",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this role",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the role",
            "type": "string"
        },
        "metadata": {
            "readOnly": true,
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name"
    ]
}
getrolecapabilities(**kwargs)

Get role-capability relation items by CQL query and pagination parameters

GET /roles/capabilities

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-Capabilities Objects Schema",
    "description": "Response body containing role-capabilities relations for search request",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of role-capability objects matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "roleCapabilities": {
            "description": "List with found/created role-capability relations",
            "type": "array",
            "items": {
                "$ref": "roleCapability.json"
            }
        }
    }
}
getrolecapabilitysets(**kwargs)

Get role-capability-set relation items by CQL query

GET /roles/capability-sets

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Role-Capability Set Objects Schema",
    "description": "Response body containing role-capabilitySet relations for search request",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of role-capability objects matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "roleCapabilitySets": {
            "description": "List with found/created role-capabilitySet relations",
            "type": "array",
            "items": {
                "$ref": "roleCapabilitySet.json"
            }
        }
    }
}
getusercapabilities(**kwargs)

Search user capabilities by CQL query

GET /users/capabilities

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Capabilities Schema",
    "description": "User capabilities collection",
    "type": "object",
    "properties": {
        "totalRecords": {
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "userCapabilities": {
            "description": "List with found/created user-capability relations",
            "type": "array",
            "items": {
                "$ref": "userCapability.json"
            }
        }
    }
}
getusercapabilitysets(**kwargs)

Get user capabilities by CQL query and pagination parameters

GET /users/capability-sets

Keyword Arguments
  • query (str) – A query string to filter users based on matching criteria in fields.

  • limit (int) – Limit the number of elements returned in the response. (default: 10, minimum: 0)

  • offset (int) – Skip over a number of elements by specifying an offset value for the query. (default: 0, minimum: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "User Capability Set Schema",
    "description": "User capability set collection",
    "type": "object",
    "properties": {
        "totalRecords": {
            "readOnly": true,
            "description": "The total number of records matching the provided criteria",
            "type": "integer",
            "format": "int64"
        },
        "userCapabilitySets": {
            "description": "List with found/created user-capabilitySet relations",
            "type": "array",
            "items": {
                "$ref": "userCapabilitySet.json"
            }
        }
    }
}
getuserroles(id_)

Get roles user by user ID

GET /roles/users/{id}

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "userRoles.json",
    "title": "List of User-Role Relation Items Schema",
    "description": "List of user-role relation items",
    "type": "object",
    "properties": {
        "userRoles": {
            "description": "List of user-role relation items",
            "type": "array",
            "items": {
                "$ref": "userRole.json"
            },
            "nullable": false
        },
        "totalRecords": {
            "description": "The total number of user-role relation items matching the provided criteria",
            "type": "integer"
        }
    }
}
migratepolicies()

Migrate user policies from mod-permission to keycloak

POST /roles-keycloak/migrate

Raises
  • OkapiRequestError – Error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

updatecapabilityset(capabilitySet, id_)

Update a capability set

PUT /capability-sets/{id}

Parameters

capabilitySet (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "title": "Capability Set Object Schema",
    "description": "Object containing the details of the capability set",
    "properties": {
        "id": {
            "description": "A unique identifier for this capability",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "a human-readable name/label for this capability.  Takes the form of {resourceName}.{scope}, e.g. item.create",
            "type": "string",
            "readOnly": true
        },
        "description": {
            "description": "Free form description of the capability",
            "type": "string"
        },
        "resource": {
            "description": "The resource this capability is associated with, e.g. item",
            "type": "string",
            "pattern": "^[A-Za-z\\s]+$"
        },
        "action": {
            "$ref": "capabilityAction.json"
        },
        "applicationId": {
            "description": "The id of the application which defines the capability",
            "type": "string"
        },
        "type": {
            "$ref": "capabilityType.json"
        },
        "capabilities": {
            "description": "List with assigned capability ids",
            "type": "array",
            "minItems": 1,
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        },
        "metadata": {
            "$ref": "../common/metadata.json",
            "readOnly": true
        }
    },
    "required": [
        "resource",
        "action",
        "permissions",
        "type",
        "applicationId"
    ]
}
updatepolicy(policy, id_)

Update a policy

PUT /policies/{id}

Parameters

policy (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "type": "object",
    "description": "Object containing the details of the policy.",
    "properties": {
        "id": {
            "description": "A unique identifier for this policy. System-generated if not provided.",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this policy. Required.",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the policy. Optional.",
            "type": "string"
        },
        "type": {
            "$ref": "policyType.json"
        },
        "userPolicy": {
            "$ref": "userPolicy.json"
        },
        "timePolicy": {
            "$ref": "timePolicy.json"
        },
        "rolePolicy": {
            "$ref": "rolePolicy.json"
        },
        "metadata": {
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name",
        "type"
    ]
}
updaterole(role, id_)

Update a role

PUT /roles/{id}

Parameters

role (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "role.json",
    "title": "Role schema",
    "description": "Role",
    "type": "object",
    "properties": {
        "id": {
            "description": "Role identifier",
            "type": "string",
            "format": "uuid"
        },
        "name": {
            "description": "A human-readable name/label for this role",
            "type": "string"
        },
        "description": {
            "description": "Free form description of the role",
            "type": "string"
        },
        "metadata": {
            "readOnly": true,
            "$ref": "../common/metadata.json"
        }
    },
    "required": [
        "name"
    ]
}
updaterolecapabilities(capabilitiesUpdateRequest, id_)

Modifies the set of capabilities assigned to the specified role.

PUT /roles/{id}/capabilities

Parameters

capabilitiesUpdateRequest (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "roleCapabilitiesUpdateRequest.json.json",
    "title": "Capability Relation Update Request Schema",
    "description": "Request body to update capabilities assigned to entity (role, user, etc.)",
    "type": "object",
    "properties": {
        "capabilityIds": {
            "description": "List of capability identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        }
    },
    "required": [
        "capabilityIds"
    ]
}
updaterolecapabilitysets(capabilitySetsUpdateRequest, id_)

Modifies the set of capability sets assigned to the specified role.

PUT /roles/{id}/capability-sets

Parameters

capabilitySetsUpdateRequest (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Set Relation Update Request Schema",
    "description": "Request body to update capability sets assigned to entity (role, user, etc.)",
    "type": "object",
    "properties": {
        "capabilitySetIds": {
            "description": "List of capability set identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        }
    },
    "required": [
        "capabilitySetIds"
    ]
}
updateusercapabilities(capabilitiesUpdateRequest, id_)

Modifies the set of capabilities assigned to the specified user.

PUT /users/{id}/capabilities

Parameters

capabilitiesUpdateRequest (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "roleCapabilitiesUpdateRequest.json.json",
    "title": "Capability Relation Update Request Schema",
    "description": "Request body to update capabilities assigned to entity (role, user, etc.)",
    "type": "object",
    "properties": {
        "capabilityIds": {
            "description": "List of capability identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        }
    },
    "required": [
        "capabilityIds"
    ]
}
updateusercapabilitysets(capabilitySetsUpdateRequest, id_)

Modifies the set of capability sets assigned to the specified user.

PUT /users/{id}/capability-sets

Parameters

capabilitySetsUpdateRequest (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Capability Set Relation Update Request Schema",
    "description": "Request body to update capability sets assigned to entity (role, user, etc.)",
    "type": "object",
    "properties": {
        "capabilitySetIds": {
            "description": "List of capability set identifiers",
            "type": "array",
            "items": {
                "type": "string",
                "description": "Capability identifier",
                "format": "uuid"
            }
        }
    },
    "required": [
        "capabilitySetIds"
    ]
}
updateuserroles(userRolesRequest, id_)

Update a roles user by user ID

PUT /roles/users/{id}

Parameters

userRolesRequest (dict) – See Schema below.

Raises
  • OkapiRequestNotFound – Not found error response in JSON format for validation errors.

  • OkapiRequestFatalError – Error response for unhandled or critical server exceptions, e.g. NullPointerException.

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "userRolesRequest.json",
    "title": "User-roles relation Batch Request Schema",
    "description": "User-roles request body",
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "format": "uuid",
            "description": "User identifier (UUID)"
        },
        "roleIds": {
            "type": "array",
            "description": "Role identifiers",
            "items": {
                "type": "string",
                "format": "uuid",
                "description": "Role identifier (UUID)"
            }
        }
    }
}