Total Complexity | 2 |
Total Lines | 21 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | # -*- coding: utf-8 -*- |
||
2 | |||
3 | from Acquisition import aq_inner |
||
4 | from Products.CMFCore.utils import getToolByName |
||
5 | from Products.CMFPlone.controlpanel.browser.usergroups_usersoverview import \ |
||
6 | UsersOverviewControlPanel as BaseView |
||
7 | from senaite.core.config.roles import HIDDEN_ROLES |
||
8 | |||
9 | |||
10 | class UsersOverviewControlPanel(BaseView): |
||
11 | """Custom userprefs controlpanel |
||
12 | """ |
||
13 | |||
14 | @property |
||
15 | def portal_roles(self): |
||
16 | """Return only SENAITE Roles |
||
17 | """ |
||
18 | pmemb = getToolByName(aq_inner(self.context), "portal_membership") |
||
19 | roles = pmemb.getPortalRoles() |
||
20 | return filter(lambda r: r not in HIDDEN_ROLES, roles) |
||
21 |