def update(self): if not self.available: return context = self.context mtool = getToolByName(context, 'portal_membership') gtool = getToolByName(context, 'portal_groups') room = self.context.getProjectRoom() self.state = room.getProjectRoomState() self.title = room.Title() self.project_url = room.absolute_url() result = [] for name in room.participants: title = name url = None if name == 'AuthenticatedUsers': title = translate(u'Authenticated Users (Virtual Group)', domain='plone', context=self.request) result.append(dict(name=name, title=title, url=None)) continue member = mtool.getMemberById(name) if member is not None: title = member.getProperty("fullname") or name url = get_user_profile_url(context, name) else: group = gtool.getGroupById(name) if group is not None: title = group.getProperty('title') or name result.append(dict(name=name, title=title, url=url)) self.participants = result
def update(self): super(PersonalBarViewlet, self).update() context = self.context mtool = getToolByName(context, "portal_membership") self.anonymous = bool(mtool.isAnonymousUser()) if self.anonymous: return sm = getSecurityManager() member = mtool.getAuthenticatedMember() userid = member.getId() self.userid = userid self.user_name = get_fullname(context, userid) self.can_manage_users = sm.checkPermission('Manage users', self.context) self.profile_url = get_user_profile_url(context, userid)
def update(self): super(PersonalBarViewlet, self).update() context = self.context mtool = getToolByName(context, "portal_membership") self.anonymous = bool(mtool.isAnonymousUser()) if self.anonymous: return sm = getSecurityManager() member = mtool.getAuthenticatedMember() userid = member.getId() self.userid = userid self.user_name = get_fullname(context, userid) self.can_manage_users = sm.checkPermission('Manage users', self.context) self.profile_url = get_user_profile_url(context, userid) self.personal_folder_url = get_personal_folder_url(context, userid)
def user_url(self, member_id): return get_user_profile_url(self.context, member_id)