Ignore:
Timestamp:
17 Mar 2011, 21:18:36 (14 years ago)
Author:
Henrik Bettermann
Message:

Customize order of member listing.

Write-protect position field which is used for member list order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.plonetheme/trunk/waeup/plonetheme/adapter.py

    r5870 r5871  
    11from plone.app.users.browser.personalpreferences import UserDataPanelAdapter
     2from Products.CMFCore.utils import getToolByName
    23
    34class EnhancedUserDataPanelAdapter(UserDataPanelAdapter):
    45    """
    56    """
     7   
    68    def get_position(self):
    79        return self.context.getProperty('position', '')
    810    def set_position(self, value):
     11        membership = getToolByName(self.context, 'portal_membership')
     12        if not membership.checkPermission('Manage portal', self.context):
     13            return
    914        return self.context.setMemberProperties({'position': value})
    1015    position = property(get_position, set_position)
Note: See TracChangeset for help on using the changeset viewer.