As this is an interface change, I'd like to get some feedback on the
following patch, which basically just adds a `get_user_groups` method to
IPermissionStore and therefore to the DefaultPermissionStore, as well as
a `groups` method to the PermissionCache, giving back a set of group
strings for the perm user.
The use case would be for IPermissionPolicy plugins that would need to
ask directly for group membership of a given username (e.g. the
GringottsPlugin on TracHacks).
-- Christian
This would definitely be useful to me, and it's a pretty harmless addition.
Erik
I think it goes without saying that I like it ;)
Cheers
Col
Nothing new in this respect with the patch.
The current way to provide group information via
IPermissionGroupProvider components, see trac/perm.py.
The patch is more about being able to retrieve that information
explicitly, in the few case that might need it.
In most cases, the group membership information is not needed directly,
as permissions granted at the group level will be propagated at the user
level, and the code has only to check for permissions on for a specific
user (and resource, for fine-grained permissions). But it in some
specialized cases (like for some IPermissionPolicyProvider components),
getting group membership information explicitly is needed.
-- Christian
Unfortunately, when adding unit-tests to the feature, I realized that
the current notion of group is wired into the DefaultPermissionStore,
itself a "kind of" group provider.
A proper way to fix this would probably involve to move the
IPermissionGroupProvider extension point from the DefaultPermissionStore
to the PermissionSystem and have the DefaultPermissionStore simply
implement the IPermissionGroupProvider interface. But this probably will
have performance issues.
In short: this requires more work to get it working properly, so
probably a 0.12 thing.
-- Christian