from plone.app.users.browser.personalpreferences import UserDataPanelAdapter from Products.CMFCore.utils import getToolByName class EnhancedUserDataPanelAdapter(UserDataPanelAdapter): """ """ def get_position(self): return self.context.getProperty('position', '') def set_position(self, value): membership = getToolByName(self.context, 'portal_membership') if not membership.checkPermission('Manage portal', self.context): return return self.context.setMemberProperties({'position': value}) position = property(get_position, set_position) def get_company(self): return self.context.getProperty('company', '') def set_company(self, value): membership = getToolByName(self.context, 'portal_membership') return self.context.setMemberProperties({'company': value}) company = property(get_company, set_company)