Cell-Based Access Control (CBAC)

So let’s say you have a REST API with some resource endpoints exposed and you want to create a simple Authorization system for accessing the Resources. There are several options to choose from, but they all have some limitations. I noticed that I used a different kind of access control in my home-grown projects. The idea is the following: all resources are part of some cells and the cell combinations form entities. Basically all users are one type of an entity. CBAC is closely related to ABAC but more formally defined.

Cell-Based Access Control (CBAC)
Cell-Based Access Control (CBAC) Resources, cells, and users i.e. groups of cells

At this point there is no access control defined yet. Next, we will define connections which connect cells to each other cells using SCRWD -type connections. SCRWD refers to Search, Create, Read, Write, Destroy (see my other blog post). Access rights are then defined as reach:

  • For a user, check from which cells it is made of i.e. entity type
  • For those cells the user has full SCRWD access over the cells’ Resources
  • Additionally, the user has access to Resources which can be reached via direct connection
  • For example, Bob is made of cells C2. C2 has full SCRWD access to Resources R2 and R7, and C2 is connected to Resources of C1 (only Destroy) and C3 (Create and Destroy). That means Destroy access to R1 and Create plus Destroy access to R3, R5, and R6.

Cell-Based Access Control (CBAC)
Cell-Based Access Control (CBAC) Connection types, connections, and rights