rhino-security
rhino-security copied to clipboard
DetachUserFromGroup detaches all the users for that group instead of the single user
I have been trying to figure out why the user-group associations were disappearing in my app and it turns out that when you call DetachUserFromGroup, it detaches all the users in that group. The query generated is: exec sp_executesql N'DELETE FROM security.UsersToUsersGroups WHERE GroupId = @p0',N'@p0 uniqueidentifier',@p0='15430BE5-E373-4ECE-905E-9D5000C6079A'
As you can see in the Where clause it is missing part where it checks for the UserId.
Looking at the AuthorizationRepository, it does remove the IUser from the list of users for the group, but somehow it is not being translated to the SQL query.