Comment
Above in this comment thread:
mxm Workgroups for Plone » Workgroup folder as portal tab » You should look in the workgroup_tool
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
|
|
thanks for your time,
Alf
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
python:member and (member.id in here.portal_workgrouptool.getGroupMembers('GroupNameHere'))
Can you point me in the correct direction?
Thanks,
-Doug