diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-12-20 23:28:33 -0500 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2010-12-21 13:00:15 -0500 |
commit | 4d6cd892581d6ce402feb3351c6cb41b932a54f5 (patch) | |
tree | b9e66e40160902c1cd7e6efb28d6e6b6e2561300 /ipalib/plugins/baseldap.py | |
parent | 1a7f5e0cc4e66db243ce29f09d77479fc981099e (diff) | |
download | freeipa-4d6cd892581d6ce402feb3351c6cb41b932a54f5.tar.gz freeipa-4d6cd892581d6ce402feb3351c6cb41b932a54f5.tar.xz freeipa-4d6cd892581d6ce402feb3351c6cb41b932a54f5.zip |
In meta data make ACI attributes lower-case, sorted. Add possible attributes.
The metadata contains a list of possible attributes that an ACI for that
object might need. Add a new variable to hold possible objectclasses for
optional elements (like posixGroup for groups).
To make the list easier to handle sort it and make it all lower-case.
Fix a couple of missed camel-case attributes in the default ACI list.
ticket 641
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index d91fd938f..259d02b01 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -233,6 +233,9 @@ class LDAPObject(Object): object_name_plural = 'entries' object_class = [] object_class_config = None + # If an objectclass is possible but not default in an entry. Needed for + # collecting attributes for ACI UI. + possible_objectclasses = [] search_attributes = [] search_attributes_config = None default_attributes = [] @@ -356,17 +359,19 @@ class LDAPObject(Object): objectclasses = config.get( self.object_class_config, objectclasses ) + objectclasses += self.possible_objectclasses # Get list of available attributes for this object for use # in the ACI UI. attrs = self.api.Backend.ldap2.schema.attribute_types(objectclasses) attrlist = [] # Go through the MUST first for (oid, attr) in attrs[0].iteritems(): - attrlist.append(attr.names[0]) + attrlist.append(attr.names[0].lower()) # And now the MAY for (oid, attr) in attrs[1].iteritems(): - attrlist.append(attr.names[0]) + attrlist.append(attr.names[0].lower()) json_dict['aciattrs'] = attrlist + attrlist.sort() json_dict['methods'] = [m for m in self.methods] return json_dict |