How to use Dynamic Groups Plugin

The instructions below are from: http://www.uwosh.edu/ploneprojects/docs/how-tos/how-to-create-a-dynamic-group but is no longer available. I got a copy from the way back machine.


  1. Login as a manager
  2. Through the ZMI open up your Plone site's acl_users object
  3. Add a "Dynamic Groups Plugin"
  • Set Id to "dynamic_groups"
  • Set Title to "Dynamic Groups Provider"
  • Click on your newly created "dynamic_groups" object
  1. Click on "Add a group"
  • Set Group Id and Title to the desired group name
  • Set Predicate to a TAL expression that determines which users should be in your group. For example, to create group that only includes members with uwosh.edu email addresses set Predicate to:

python: principal.getProperty('email').endswith('@uwosh.edu')

  1. Finally, open up the "Activate" tab of your "dynamic_groups" object, check the boxes next to both "Group_Enumeration" and "Groups", and click "Update".

And you're done!! Your new group should show up in the Users and Groups configlet. And any members who qualify for the group should be members of it.


However, it was not enough. I also needed to add the same group in my dynamic group in the regular group (same ids) acl_users/source_groups. I got the hint from

It works and I do not experience the bug reported at https://github.com/plone/Products.CMFPlone/issues/2804 and https://github.com/plone/Products.CMFPlone/issues/2773

Are the above instructions now complete and correct? There is little information about Plone dynamic groups on the Internet.

Some time ago I wrote this add-on:

I used it in production at the time and it worked fine. The drawback from the dynamic groups solution provided out of the box is that you need to write Python code to create a dynamic group.

In the source code I see monkey patches that I think were made to fix the Products.CMFPlone issues you mentioned.

I hope this helps.

Your plugin was among the top results from a Google search of "Plone dynamic groups".

I tested this on 5.1.4 and it works. I just needed to add a group to "acl_users/anotherdynamic-groups-plugin" which is created after the product is activated. Listing of available groups in the control panel works fine with the plugin.

Thanks!

1 Like