Timeline for Implementing DDD: users and permissions
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 29, 2019 at 19:45 | comment | added | Jordan | Unless you have a very complex collaborative context you can probably afford to implement an optimistic concurrency model here using versioning, but if your checks aren't done within or at least against a particular aggregate instance then your checks may fail to be consistent with the actual state of the object by the time you persist your changes. | |
Nov 29, 2019 at 19:43 | comment | added | Jordan | I'm still looking for answers/direction on this myself, but I've found that any authorization logic which relies on the current state of the object (such as if it's currently assigned to a moderator) is in fact business logic which belongs in your domain and further that if it is not in your domain you risk ending up in an invalid state if the model can be updated concurrently. For instance if you validate ownership using a policy and then go to update that object - in many domains that ownership is subject to change and the action may no longer be valid. | |
Mar 15, 2018 at 12:58 | comment | added | LittlePilgrim |
Maybe I'm too confused by now, but my interpretation was (for both answers): 1. Keep security concerns out of the domain and use the security BC as a service 2. Call the service before invoking any domain objects 3. The service will do the mapping from users/acls to moderators, authors, etc. moderator = securityService.GetModerator(userId, forumId) 4. Domain logic will be implemented in these objects like in moderator.EditPost() 5. Methods like EditPost will know nothing about security concepts, there will be no additional checks there
|
|
Mar 15, 2018 at 12:14 | comment | added | Ewan | I have to say I think this in the complete opposite of my answer. | |
Mar 15, 2018 at 12:07 | comment | added | LittlePilgrim | As both answers are useful and more or less are pointing to the same direction I have upvoted them both. I accepted this one, as @guillaume31 has more or less answered my question about Vernon's implementation and I'll continue with my implementation based on his hint about using resources in the Security BC. | |
Mar 15, 2018 at 11:39 | vote | accept | LittlePilgrim | ||
Mar 15, 2018 at 8:44 | history | answered | guillaume31 | CC BY-SA 3.0 |