Add handling for indirect memberof other entries.

This creates a new custom attribute, memberofindirect_[plugin].
Using this you can tell the difference between being an actual memberof
another entry and being a memberof as the result if inheritence. This is
particularly useful when trying to remove members of an entry, you can
only remove direct members.

I had to add a couple of short sleep calls to make things work a little
better. The memberof plugin runs as a postop and we have no way of knowing
when it has done its work. If we don't pause we may show some stale
data that memberof hasn't updated yet. .3 seconds is an arbitrary choice.

ticket 966
This commit is contained in:
Rob Crittenden
2011-02-19 23:09:03 -05:00
parent 18be4ebec3
commit 2f82112bb3
10 changed files with 265 additions and 10 deletions

View File

@@ -85,13 +85,14 @@ class group(LDAPObject):
search_attributes_config = 'ipagroupsearchfields'
default_attributes = [
'cn', 'description', 'gidnumber', 'member', 'memberof',
'memberindirect',
'memberindirect', 'memberofindirect',
]
uuid_attribute = 'ipauniqueid'
attribute_members = {
'member': ['user', 'group'],
'memberof': ['group', 'netgroup', 'role',],
'memberindirect': ['user', 'group', 'netgroup', 'role'],
'memberofindirect': ['group', 'netgroup', 'role'],
}
rdnattr = 'cn'