diff --git a/README.md b/README.md index 0f365b6ee5..f6f2877bbb 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ addon | version | maintainers | summary [auth_user_case_insensitive](auth_user_case_insensitive/) | 15.0.1.0.0 | | Makes the user login field case insensitive [password_security](password_security/) | 15.0.1.4.1 | | Allow admin to set password security requirements. [user_log_view](user_log_view/) | 15.0.1.0.0 | [](https://github.com/trojikman) | Allow to see user's actions log -[users_ldap_groups](users_ldap_groups/) | 15.0.1.0.0 | | Adds user accounts to groups based on rules defined by the administrator. +[users_ldap_groups](users_ldap_groups/) | 15.0.1.0.1 | | Adds user accounts to groups based on rules defined by the administrator. [vault](vault/) | 15.0.2.1.0 | | Password vault integration in Odoo [vault_share](vault_share/) | 15.0.1.1.1 | | Implementation of a mechanism to share secrets diff --git a/users_ldap_groups/README.rst b/users_ldap_groups/README.rst index dfb344485f..12cbbeab51 100644 --- a/users_ldap_groups/README.rst +++ b/users_ldap_groups/README.rst @@ -7,7 +7,7 @@ LDAP groups assignment !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:078a6ff3b7932f9af4da1b3af63e6b503dfbdb5026b3bbdcfee95372995c3ae2 + !! source digest: sha256:253ac657c30d5cabc678c49abf46ac34eb388e24a56b279f2222e1a3a2e1e031 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/users_ldap_groups/__manifest__.py b/users_ldap_groups/__manifest__.py index 0a408ff333..d4fa690920 100644 --- a/users_ldap_groups/__manifest__.py +++ b/users_ldap_groups/__manifest__.py @@ -4,7 +4,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "LDAP groups assignment", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "depends": ["auth_ldap"], "author": "Therp BV, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/server-auth", diff --git a/users_ldap_groups/models/res_company_ldap.py b/users_ldap_groups/models/res_company_ldap.py index 0125181309..6fcf160aa7 100644 --- a/users_ldap_groups/models/res_company_ldap.py +++ b/users_ldap_groups/models/res_company_ldap.py @@ -48,7 +48,7 @@ def _get_or_create_user(self, conf, login, ldap_entry): _logger.debug("deleting all groups from user %d", user_id) groups.append((5, False, False)) for mapping in this.group_mapping_ids: - operator = getattr(op_obj, mapping.operator) + operator = getattr(op_obj, f"_{mapping.operator}") _logger.debug("checking mapping %s", mapping) if operator(ldap_entry, mapping): _logger.debug( diff --git a/users_ldap_groups/models/res_company_ldap_operator.py b/users_ldap_groups/models/res_company_ldap_operator.py index 2436754a0c..fedafa9115 100644 --- a/users_ldap_groups/models/res_company_ldap_operator.py +++ b/users_ldap_groups/models/res_company_ldap_operator.py @@ -17,20 +17,20 @@ class ResCompanyLdapOperator(models.AbstractModel): @api.model def operators(self): - """Return names of function to call on this model as operator""" + """Return names (without '_') of function to call on this model as operator""" return ("contains", "equals", "query") - def contains(self, ldap_entry, mapping): + def _contains(self, ldap_entry, mapping): return mapping.ldap_attribute in ldap_entry[1] and mapping.value in map( lambda x: x.decode(), ldap_entry[1][mapping.ldap_attribute] ) - def equals(self, ldap_entry, mapping): + def _equals(self, ldap_entry, mapping): return mapping.ldap_attribute in ldap_entry[1] and mapping.value == str( list(map(lambda x: x.decode(), ldap_entry[1][mapping.ldap_attribute])) ) - def query(self, ldap_entry, mapping): + def _query(self, ldap_entry, mapping): query_string = Template(mapping.value).safe_substitute( {attr: ldap_entry[1][attr][0].decode() for attr in ldap_entry[1]} ) diff --git a/users_ldap_groups/static/description/index.html b/users_ldap_groups/static/description/index.html index 91a75b919a..4600a6cf16 100644 --- a/users_ldap_groups/static/description/index.html +++ b/users_ldap_groups/static/description/index.html @@ -1,4 +1,3 @@ -
@@ -367,7 +366,7 @@