mercredi 8 novembre 2023

Where to fetch data for permissions in Clean Architecture?

Using Clean Architecture I need to implement permissions.

I decided to implement additional permissions layer PermissionsChecker. My permissions depend on database state. I have assigned permissions to the user in database as well as it depends on the state of the domain object. I have adapter for my database. Now where should I fetch data using that adapter?

  1. Should I fetch data on the use case level and pass it down to the PermissionChecker?
  2. Or Should I fetch data on the permission layer? But then PermissionChecker would have dependency to database port.
  3. Or other solution that I didn't think of?

Aucun commentaire:

Enregistrer un commentaire