majewsky / portunus

Self-contained user/group management and authentication service
GNU General Public License v3.0
75 stars 5 forks source link

Add option to not seed group members #18

Closed SuperSandro2000 closed 12 months ago

SuperSandro2000 commented 1 year ago

I still need to test on our portunus installation.

SuperSandro2000 commented 1 year ago

Just tested it again and works as expected.

majewsky commented 12 months ago

We talked about this IRL and figured out what the real problem was: In the user-edit workflow, we end up with a state like:

newState.MemberLoginNames = { "user-being-edited": false, "user-being-seeded": true }

which ends up being compared with

newStateWithSeedApplied.MemberLoginNames = { "user-being-seeded": true }

That's technically the same thing, but reflect.DeepEqual does not understand this. I fixed this in daa9ac8d51d3415e62cbcbe8491cd0ca7ae6fa44 by sending both sides of the comparison through Group.Cloned() which normalizes the MemberLoginNames map into a consistent format.