Skip to content

Commit

Permalink
Merge pull request #469 from OCA/15.0
Browse files Browse the repository at this point in the history
Syncing from upstream OCA/server-auth (15.0)
  • Loading branch information
bt-admin authored Jun 7, 2024
2 parents 18d2b5b + d34a8af commit 195e634
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | [![trojikman](https://github.com/trojikman.png?size=30px)](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

Expand Down
2 changes: 1 addition & 1 deletion users_ldap_groups/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion users_ldap_groups/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion users_ldap_groups/models/res_company_ldap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions users_ldap_groups/models/res_company_ldap_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]}
)
Expand Down
3 changes: 1 addition & 2 deletions users_ldap_groups/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down Expand Up @@ -367,7 +366,7 @@ <h1 class="title">LDAP groups assignment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:078a6ff3b7932f9af4da1b3af63e6b503dfbdb5026b3bbdcfee95372995c3ae2
!! source digest: sha256:253ac657c30d5cabc678c49abf46ac34eb388e24a56b279f2222e1a3a2e1e031
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-auth/tree/15.0/users_ldap_groups"><img alt="OCA/server-auth" src="https://img.shields.io/badge/github-OCA%2Fserver--auth-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-auth-15-0/server-auth-15-0-users_ldap_groups"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-auth&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<a class="reference external image-reference" href="https://www.gnu.org/licenses/agpl"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a>
Expand Down

0 comments on commit 195e634

Please sign in to comment.