Reputation: 135
Shall i put my identity access (Authentication and Authorization) in the shared kernel or create a separate bounded context called for example:- IdentityAccess
keep in mind, the identity access will contain a lot of features like User Login and Permission Management like(Create Users, rules and Groups)
Upvotes: 4
Views: 2059
Reputation: 9509
Identity access should NOT contain Permission management; those are business functions belonging in the separate context, see this pic from Martin Fowler:
Instead of Customer and Product in your case it will be Permission/Role/User etc. that exist in both bounded contexts.
So you should have:
Then you need to organise the code in such a way that user interaction always goes through (1) but in a way that is opaque to (2) and any number of (3).
Specifically, you should NOT worry about permissions in the business context because it should never be invokable if the user does not have appropriate permissions.
Upvotes: 2