Skip to content

mxm, IT's mad science

Sections
Personal tools
You are here: Home » Products » Open Source » mxm Workgroups for Plone » Got it working
Downloads
You can download mxm products here.

Due to it's technical and international nature, this section is in english.

Max M Has a blog too.

og er glad for mad

 

Comment

Above in this comment thread: mxm Workgroups for Plone » Workgroup folder as portal tab » You should look in the workgroup_tool » portal_actions Condition

Got it working

Posted by Anonymous User at 2005-03-03 01:19 PM
I wanted to do this as well, and have managed to get it to work after a bit of experimenting. I'm very new to both Plone and Python so I'm sure that some of this is not the best way of doing it, but it works.

1) We need to make a new version of getMembersOfGroup from mxmWorkgroupTool.py (line 242). The current one takes an object rather than a string path for the group we want, we can't get a group because if the user does not belong to the group we get an Insufficient Privileges exception thrown (comment -> maybe we could just catch the exception and return false?). I have called my new version getMemberofGroupString it is identical to the original apart from it doesn't call _o2path as we've already got the path. Paste this into the mxmWorkgroupTool.py file immediately below the end of the getMembersOfGroup method

security.declarePublic('getMembersOfGroupString')
def getMembersOfGroupString(self, group):
"Returns the accessible members of a group"
portal_membership = getToolByName(self, 'portal_membership')
member_ids = self._get(group)
groupmembers = self._ids2members(member_ids)
return groupmembers

2) Set up the condition on the tab
python:member in portal.mxm_workgroups.getMembersOfGroupString('<path to your group>')

for example
python:member in portal.mxm_workgroups.getMembersOfGroupString('/Plone/sales')

It works for me, hopefully will for anyone else.

Thanks for an excellent product.

Dave Sykes