mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Make sure the group permission update contains unique elements
This commit is contained in:
parent
addc4979ee
commit
96be75e177
1 changed files with 3 additions and 0 deletions
|
@ -453,6 +453,9 @@ def _update_ldap_group_permission(permission, allowed, sync_perm=True):
|
|||
|
||||
allowed = [allowed] if not isinstance(allowed, list) else allowed
|
||||
|
||||
# Guarantee uniqueness of values in allowed, which would otherwise make ldap.update angry.
|
||||
allowed = set(allowed)
|
||||
|
||||
try:
|
||||
ldap.update('cn=%s,ou=permission' % permission,
|
||||
{'groupPermission': ['cn=' + g + ',ou=groups,dc=yunohost,dc=org' for g in allowed]})
|
||||
|
|
Loading…
Add table
Reference in a new issue