Key components – managing access control
Access control is a crucial aspect of DDD, particularly in regulated industries. Only authorized entities are allowed to interact with specific parts of the domain model, which reflects real-world permissions and constraints. In DDD, a layered architecture is commonly employed for access control, whereby policies are enforced at the application layer. This strategy enables a clear separation of concerns, with the domain layer focused on business logic and the application layer handling authorization.
Two patterns that can be used to implement access control in DDD are as follows:
- Role-based access control (RBAC): RBAC links permissions with roles within an organization. It simplifies management as users change positions within an organization. You can see a simple example in this diagram.
Figure 8.3 – An RBAC example
- Attribute-Based Access Control (ABAC): ABAC considers various...