Last change
on this file since 5872 was
5871,
checked in by Henrik Bettermann, 14 years ago
|
Customize order of member listing.
Write-protect position field which is used for member list order.
|
-
Property svn:keywords set to
Id
|
File size:
613 bytes
|
Line | |
---|
1 | from plone.app.users.browser.personalpreferences import UserDataPanelAdapter |
---|
2 | from Products.CMFCore.utils import getToolByName |
---|
3 | |
---|
4 | class EnhancedUserDataPanelAdapter(UserDataPanelAdapter): |
---|
5 | """ |
---|
6 | """ |
---|
7 | |
---|
8 | def get_position(self): |
---|
9 | return self.context.getProperty('position', '') |
---|
10 | def set_position(self, value): |
---|
11 | membership = getToolByName(self.context, 'portal_membership') |
---|
12 | if not membership.checkPermission('Manage portal', self.context): |
---|
13 | return |
---|
14 | return self.context.setMemberProperties({'position': value}) |
---|
15 | position = property(get_position, set_position) |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | |
---|
Note: See
TracBrowser for help on using the repository browser.