Previews which users would be admitted to a private room with the given ABAC attributes, without saving anything. ABAC must be enabled. The request body takes one of two forms:
- New room: send
membersandattributes(and optionallyexcludeSelf) to preview who would be added when creating an ABAC-managed private room or team. The response sorts the named users intocompliant,nonCompliantandinconclusive, and returns the caller's own verdict increator. If the caller does not meet the attributes andexcludeSelfis nottrue, the request fails witherror-abac-creator-not-admitted. Permission required:create-abac-managed-room. The named users, plus the caller unlessexcludeSelfistrue, cannot exceed the API_User_Limit setting. - Existing room: send
ridand the proposedattributesto preview which current members keep or lose access if the room's attributes change. Results are paginated with theaftercursor and can be narrowed withfilterandgroup. Each member has averdict. On the first page,editorholds the caller's own verdict when the caller is a member. Permissions required:abac-managementandmanage-abac-admin-rooms, oredit-room-abac-attributesin that room. Room members without that permission and users who are not room members receive a403error.
A member is compliant only if they hold every value listed for each key. The existing room form does not accept count or offset in the body (error-invalid-params), and ignores them as query parameters.
Successful new room previews are recorded in the ABAC audit log as an abac.membership.evaluated event. Existing room previews and failed requests are not recorded. The endpoint is rate limited to 20 requests every 10 seconds, except for users with the abac-management and manage-abac-admin-rooms permissions.
ABAC errors such as error-abac-not-enabled use the ABAC error contract: the key is returned in both error and errorType, and details names the attribute or cause at fault when there is one. error-room-not-found and error-invalid-attribute-values return only error, without errorType.
Changelog
| Version | Description |
|---|---|
| 9.0.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
{
"members": [
"jane.doe",
"john.roe"
],
"attributes": {
"clearance": [
"secret"
],
"department": [
"engineering"
]
},
"excludeSelf": false
}{
"rid": "64f0a1c2b3d4e5f6a7b8c9d0",
"attributes": {
"clearance": [
"secret"
]
},
"group": "loses"
}New room form only (required). Usernames of the users to evaluate. Values must be unique.
New room form only. If true, the caller is not evaluated as a member. Defaults to false.
Existing room form only (required). The ID of the private room whose members you want to evaluate.
Required. Map of attribute keys to the values to evaluate. Keys and values can contain letters, digits, _ and -. Each key takes 1 to 10 unique values, and up to 10 keys are allowed.
In the new room form, at least one key is required. In the existing room form, an empty object previews clearing all attributes.
Existing room form only. Text to search members by. Matches the username or the name.
Existing room form only. Return only the members who would lose access (loses) or keep it (retains).
Existing room form only. The next cursor from the previous response, used to fetch the next page.
OK
{
"compliant": [
{
"_id": "aB3dE5fG7hJ9kL1mN",
"username": "jane.doe",
"name": "Jane Doe"
}
],
"nonCompliant": [
{
"_id": "pQ2rS4tU6vW8xY0zA",
"username": "john.roe",
"name": "John Roe"
}
],
"inconclusive": [],
"creator": "compliant",
"success": true
}{
"members": [
{
"_id": "pQ2rS4tU6vW8xY0zA",
"username": "john.roe",
"name": "John Roe",
"verdict": "nonCompliant",
"roles": [
"owner"
]
}
],
"count": 1,
"checked": 12,
"total": 12,
"editor": "compliant",
"success": true
}{
"members": [
{
"_id": "aB3dE5fG7hJ9kL1mN",
"username": "jane.doe",
"name": "Jane Doe",
"verdict": "compliant",
"roles": [
"owner"
]
},
{
"_id": "pQ2rS4tU6vW8xY0zA",
"username": "john.roe",
"name": "John Roe",
"verdict": "nonCompliant"
}
],
"checked": 2,
"total": 2,
"count": 2,
"editor": "compliant",
"success": true
}New room form. Users who would be added.
New room form. Users who would be skipped.
New room form. Users whose access could not be decided.
New room form. The caller's verdict.
Existing room form. The evaluated members on this page.
The member's room roles, for example owner. Omitted for members without a room role.
Existing room form. Number of members returned on this page.
Existing room form. Number of members checked to build this page.
Existing room form. Total number of room members, when known.
Existing room form. Cursor to pass as after for the next page. Absent on the last page.
Existing room form, first page only. The caller's verdict when the caller is a room member.
Bad Request
{
"success": false,
"error": "error-abac-not-enabled",
"errorType": "error-abac-not-enabled"
}{
"success": false,
"error": "error-abac-preview-too-many-members",
"errorType": "error-abac-preview-too-many-members"
}{
"success": false,
"error": "error-abac-attribute-not-assignable",
"errorType": "error-abac-attribute-not-assignable",
"details": {
"cause": "error-invalid-attribute-values",
"attributes": [
{
"key": "clearance",
"values": [
"topsecret"
]
}
]
}
}{
"success": false,
"error": "error-abac-creator-not-admitted",
"errorType": "error-abac-creator-not-admitted"
}{
"success": false,
"error": "must have required property 'members'\n must have required property 'rid'\n must match exactly one schema in oneOf",
"errorType": "error-invalid-params"
}{
"success": false,
"error": "must have required property 'members'\n must have required property 'attributes'\n must match exactly one schema in oneOf",
"errorType": "error-invalid-params"
}{
"success": false,
"error": "error-room-not-found"
}{
"success": false,
"error": "error-invalid-attribute-values"
}{
"success": false,
"error": "error-abac-decision-unavailable",
"errorType": "error-abac-decision-unavailable"
}Present only when a specific attribute or cause is at fault.
Unauthorized
{
"success": false,
"error": "You must be logged in to do this."
}Forbidden
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}