Primary problem:
We frequently want to know the full closure of group membership. The groups attribute of is a list of groups to which the principal directly belongs. The full closure--including the groups to which the principal's groups belong, for instance--must be calculated by any piece of code that needs it.

Secondary problem:
The description of does not sufficiently clarify that it is *not* a full closure.

Consideration: has been around for awhile, and probably should not be materially changed (i.e., to redefine or add an attribute).


1) Clarify the description: change from
"List of ids of groups the principal belongs to"
"List of ids of groups to which the principal directly belongs"

2) Add an additional interface to interface.

class IGroupClosureAwarePrincipal(IGroupAwarePrincipal):
    allGroups = interface.Attribute(
'a readonly iterable of the full closure of the principal's groups.')

3) Make the principals in implement IGroupClosureAwarePrincipal. First cut of 'allGroups' would probably be to make it be a lazy property, returning a tuple of the full closure.

Some might be unhappy that allGroups is not a hook point, but a convenience: that is, it will be a full closure, not an opportunity to be clever to redefine how group membership is calculated.


Zope3-dev mailing list

Reply via email to