'If allowed by the configuration, this returns the set of permissions
defined by the user\'s LDAP group memberships.'

def get_group_permissions(self):

    if (self._group_permissions is None):
        self._group_permissions = set()
        if self.settings.FIND_GROUP_PERMS:
            try:
                self._load_group_permissions()
            except ldap.LDAPError as e:
                logger.warning('Caught    LDAPError    loading    group    permissions:    %s', pprint.pformat(e))
    return self._group_permissions
