Ticket #8557 (closed Bug: fixed)
Nested groups are not shown in prefs_group_members
| Reported by: | michaellaunay | Owned by: | vincentfretin |
|---|---|---|---|
| Priority: | major | Milestone: | 3.3.5 |
| Component: | Infrastructure | Keywords: | nested group TuneUp16 forcommit |
| Cc: | vincentfretin, grahamperrin, hoss, keul |
Description
Follow steps in #8556 to add a group "group-one" to a group "group-two" by searching "group-one", check it and add.
The added group is not shown despite it is listed in acl_users/source_groups/manage_groups.
Trouble comes from getGroupMembers, it returns only members.
Attachments
Change History
comment:3 Changed 3 years ago by vincentfretin
It may be good to rewrite getAllGroupMembers to use getGroupMembers instead. The two functions seems to do the same thing, "self.getGroup().getMemberIds()" and "gtool.getGroupMembers(self.getId())" return the same principals.
comment:6 Changed 3 years ago by grahamperrin
- Cc grahamperrin added
- Milestone changed from 3.x to 3.2
See also
- ticket:7297, Adding user to group works, adding group to user doesn't
- ticket:8538, TTP view of group membership differs from ZMI view
- ticket:8710, Info 'Changes saved' is a false statement when a group addition fails without explanation.
comment:7 Changed 3 years ago by hannosch
- Priority changed from critical to major
- Keywords prefs_group_members removed
- Milestone changed from 3.2 to 3.x
Changed 3 years ago by vincentfretin
-
attachment
plone_issue_8557_nested_groups.patch
added
patch getGroupMembers (group is not wrapped twice)
comment:12 Changed 3 years ago by jnelson
- Owner set to calvinhp
- Keywords forcommit added; forqa removed
Checked functionality of the patch, and nested groups now appear in the group listing after add.
comment:13 Changed 3 years ago by vincentfretin
- Status changed from new to closed
- Resolution set to fixed
Fixed in r88963
comment:14 Changed 3 years ago by vincentfretin
- Status changed from closed to reopened
- Resolution fixed deleted
comment:15 Changed 3 years ago by vincentfretin
- Owner changed from calvinhp to vincentfretin
- Status changed from reopened to new
comment:16 Changed 3 years ago by vincentfretin
- Status changed from new to closed
- Resolution set to fixed
Fixed getAllGroupMembers too in r88975
comment:18 Changed 19 months ago by keul
- Cc keul added
Are you sure this is fixed? On Plone 3.3.5 I don't see nested groups...
comment:19 Changed 19 months ago by vincentfretin
This is fixed in the unreleased Plone 3.3.6. When will it be released? Good question!

In CMFPlone/skins/plone_prefs/prefs_group_members.cpt, we call "groupMembers group/getGroupMembers|nothing;". The getGroupMembers code can be found in the file PlonePAS/tools/groupdata.py.
getGroupMembers tries to do getUserById with the group id and PAS looks only at IUserEnumeration. So getUserById will return None if the u_name is not a user, but a group. The "elif usr.isGroup():" is NEVER executed. This code worked in Plone 2.1 with GRUF (see getUserById method in GroupUserFolder/GroupUserFolder.py of Plone 2.1) because getUserById searched first a user, and if a user was not found, it searched a group and returned a Group object if found.
I fixed the getGroupMembers to do a getGroupById if a user was not found. Please see the patch.