2 aclu
= context
.aq_inner
.acl_users
3 prefix
= aclu
.getGroupPrefix()
4 allGroupNames
= aclu
.getGroupNames()
5 usersAndGroupsWithLocalRole
= context
.users_with_local_role(role
)
7 groupsWithLocalRole
= [ gn
for gn
in usersAndGroupsWithLocalRole
if gn
.startswith(prefix
) ]
9 groupsWithoutLocalRole
= [ gn
for gn
in allGroupNames
if gn
not in groupsWithLocalRole
]
11 getGroupById
= context
.portal_groups
.getGroupById
14 def sortOnTitleOrId(m0
, m1
) :
15 return cmp(m0
.title_or_id().lower(), m1
.title_or_id().lower())
17 insideList
= map(getGroupById
, groupsWithLocalRole
)
18 outsideList
= map(getGroupById
, groupsWithoutLocalRole
)
20 insideList
.sort(sortOnTitleOrId
)
21 outsideList
.sort(sortOnTitleOrId
)
23 groupsDict
= {'inside' : insideList
,
24 'outside' : outsideList
}