Commits

Peter Sagerson committed b36671c

Add OrganizationalRoleGroupType.

Comments (0)

Files changed (3)

django_auth_ldap/config.py

     """
     def __init__(self, name_attr='cn'):
         super(NestedActiveDirectoryGroupType, self).__init__('member', name_attr)
+
+
+class OrganizationalRoleGroupType(MemberDNGroupType):
+    """
+    An LDAPGroupType subclass that handles groups of class organizationalRole.
+    """
+    def __init__(self, name_attr='cn'):
+        super(OrganizationalRoleGroupType, self).__init__('roleOccupant', name_attr)
+
+
+class NestedOrganizationalRoleGroupType(NestedMemberDNGroupType):
+    """
+    An LDAPGroupType subclass that handles groups of class OrganizationalRoleGroupType
+    with nested group references.
+    """
+    def __init__(self, name_attr='cn'):
+        super(NestedOrganizationalRoleGroupType, self).__init__('roleOccupant', name_attr)

docs/source/groups.rst

     * :class:`~django_auth_ldap.config.NestedGroupOfUniqueNamesType`
     * :class:`~django_auth_ldap.config.ActiveDirectoryGroupType`
     * :class:`~django_auth_ldap.config.NestedActiveDirectoryGroupType`
+    * :class:`~django_auth_ldap.config.OrganizationalRoleGroupType`
+    * :class:`~django_auth_ldap.config.NestedOrganizationalRoleGroupType`
 
 
 Finding Groups

docs/source/reference.rst

     .. method:: __init__(name_attr='cn')
 
 
+.. class:: OrganizationalRoleGroupType
+
+    A concrete subclass of :class:`~django_auth_ldap.config.MemberDNGroupType`
+    that handles the ``organizationalRole`` object class. Equivalent to
+    ``MemberDNGroupType('roleOccupant')``.
+
+    .. method:: __init__(name_attr='cn')
+
+
+.. class:: NestedOrganizationalRoleGroupType
+
+    A concrete subclass of
+    :class:`~django_auth_ldap.config.NestedMemberDNGroupType` that handles the
+    ``organizationalRole`` object class. Equivalent to
+    ``NestedMemberDNGroupType('roleOccupant')``.
+
+    .. method:: __init__(name_attr='cn')
+
+
 Backend
 -------