Replace room ABAC attributes

Prev Next
Post
/api/v1/abac/rooms/:rid/attributes
Defense
  • Replaces the full ABAC attribute set for a room.
  • Sets the complete set of ABAC attributes on the specified room by providing an attributes object that maps attribute keys to arrays of allowed values; any previously assigned attributes not included in the request are removed. Send an empty attributes object to remove every attribute from the room.
  • Requires the ABAC license and the global setting ABAC_Enabled to be turned on.
  • Permissions required: abac-management and manage-abac-admin-rooms, or edit-room-abac-attributes in the room. Administrators and room owners have edit-room-abac-attributes by default.
  • Users who edit through edit-room-abac-attributes have extra limits. With the local Policy Decision Point and Restrict room creators and editors to attributes they hold on (the default), they can only add values they hold. While Enforce ABAC across all workspace rooms is on and attributes are required, they cannot remove a required attribute or every attribute. These errors use the ABAC error contract: the key is in both error and errorType, and details lists the refused values or keys. ABAC administrators are not subject to these limits.
  • With Restrict room creators and editors to attributes they hold off, a room owner can add a value they do not hold. The owner then loses access to the room along with every other member who does not hold it.
  • Room members without edit-room-abac-attributes and users who are not room members receive a 403 error.
  • The change applies as soon as the request succeeds. Members who do not hold every value listed for each key are removed from the room, including the caller. To see who would lose access before saving, call POST /api/v1/abac/rooms.evaluateMembership with the room ID and the proposed attributes.
  • Errors outside the ABAC error contract, such as error-abac-not-enabled, error-invalid-attribute-values and error-attribute-definition-not-found, return only error, without errorType.
  • Adding attributes to a federated room or a discussion is refused for every user.

Changelog

Version Description
9.0.0 Added the edit-room-abac-attributes room permission as an alternative to the ABAC administration permissions. An empty attributes object now clears the room. Federated rooms and discussions are refused.
8.0.0 Added
8.5.0 Added the manage-abac-admin-rooms granular permission requirement.
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example 1
{
  "attributes": {
    "department": [
      "it",
      "sales"
    ],
    "region": [
      "asia",
      "europa"
    ]
  }
}
Clear all attributes
{
  "attributes": {}
}
Expand All
object
attributes
object

Map of attribute keys to the values the room requires, for example { "department": ["navControl"] }. Replaces every attribute the room has. A member must hold every value listed for a key to keep access. Send an empty object to remove all attributes.

Example{ "department": [ "navControl" ] }
property*
Array of string additionalProperties
string
Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
400

Bad Request

ABAC not enabled
{
  "success": false,
  "error": "error-abac-not-enabled"
}
Attribute definition missing
{
  "success": false,
  "error": "error-attribute-definition-not-found"
}
Invalid attribute values
{
  "success": false,
  "error": "error-invalid-attribute-values"
}
Federated room
{
  "success": false,
  "error": "error-abac-federated-room-attributes",
  "errorType": "error-abac-federated-room-attributes"
}
Discussion
{
  "success": false,
  "error": "error-abac-discussion-room-attributes",
  "errorType": "error-abac-discussion-room-attributes"
}
Value not assignable
{
  "success": false,
  "error": "error-abac-attribute-not-assignable",
  "errorType": "error-abac-attribute-not-assignable",
  "details": {
    "attributes": [
      {
        "key": "destination",
        "values": [
          "Brazil"
        ]
      }
    ]
  }
}
Required attributes removed
{
  "success": false,
  "error": "error-abac-required-attributes-removed",
  "errorType": "error-abac-required-attributes-removed",
  "details": {
    "keys": [
      "clearance"
    ]
  }
}
All attributes cleared
{
  "success": false,
  "error": "error-abac-room-attributes-cleared",
  "errorType": "error-abac-room-attributes-cleared"
}
Expand All
object
success
boolean
error
string
errorType
string

Returned for ABAC error contract keys. Holds the same key as error.

details
object

Returned for some ABAC error contract keys. Lists the refused values (attributes) or required keys (keys).

401

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string
403

Forbidden

Missing required ABAC permissions
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
object
success
boolean
error
string