hibernating-rhinos/rhino-security — pull request #11 by joramwangi (2013-09-06 18:03:15+00:00)
Title: Fix createchildusergroup

Sorry about the whitespace. main change was

public virtual UsersGroup CreateChildUserGroupOf(string parentGroupName, string usersGroupName)
{
UsersGroup parent = GetUsersGroupByName(parentGroupName);
Guard.Against(parent == null,
"Parent users group '" + parentGroupName + "' does not exists");

UsersGroup group = CreateUsersGroup(usersGroupName);
group.Parent = parent;
group.AllParents.AddAll(parent.AllParents);
group.AllParents.Add(parent);
parent.DirectChildren.Add(group);
- parent.AllChildren.Add(group);
+ foreach(UsersGroup prnt in group.AllParents)
+ {
+ prnt.AllChildren.Add(group);
+ }
+
return group;
}

Initially only direct children were being added and thus if in a nested scenario group.AllChildren will only return direct children unlike group.AllParents