Ticket #8557 (closed Bug: fixed)

Opened 3 years ago

Last modified 19 months ago

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

plone_issue_8557_nested_groups.patch Download (1.2 KB) - added by vincentfretin 3 years ago.
patch getGroupMembers (group is not wrapped twice)

Change History

comment:1 Changed 3 years ago by vincentfretin

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.

comment:2 Changed 3 years ago by vincentfretin

  • Cc vincentfretin@… added

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:4 Changed 3 years ago by vincentfretin

A same issue was reported 2 months ago at #8421. I marked as duplicate #8421 because there is more informations to this one.

comment:5 Changed 3 years ago by vincentfretin

  • Cc vincentfretin added; vincentfretin@… removed

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

comment:8 Changed 3 years ago by hannosch

  • Component changed from Users/Groups to Infrastructure

Changed 3 years ago by vincentfretin

patch getGroupMembers (group is not wrapped twice)

comment:9 Changed 3 years ago by lucie

  • Keywords TuneUp15 added

comment:10 Changed 3 years ago by jluvsu2

  • Keywords TuneUp16 added; TuneUp15 removed

comment:11 Changed 3 years ago by jnelson

  • Keywords forqa added

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:17 Changed 3 years ago by hoss

  • Cc hoss added

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!

Note: See TracTickets for help on using tickets.