mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Add info about validate uniqueness
This commit is contained in:
parent
051ed333d6
commit
ae73721e8f
1 changed files with 14 additions and 1 deletions
15
doc/ldap.rst
15
doc/ldap.rst
|
@ -333,7 +333,7 @@ Validate uniqueness
|
|||
===================
|
||||
|
||||
There is a method to validate the uniquess of some entry that is used during
|
||||
user creation. I haven't used it and I'm not sure on how it work.
|
||||
user creation. It's usefull by example to be sure that we have no conflict about email between each user.
|
||||
|
||||
Here is how it's used (I don't understand why a path is not provided):
|
||||
|
||||
|
@ -349,6 +349,19 @@ And here is its docstring:
|
|||
|
||||
.. automethod:: moulinette.authenticators.ldap.Authenticator.update
|
||||
|
||||
Get conflict
|
||||
============
|
||||
|
||||
Like the last function `validate_uniqueness` but give instead of rising an error this function return which attribute with witch value generate a conflict.
|
||||
|
||||
::
|
||||
# Validate uniqueness of groupname in LDAP
|
||||
conflict = auth.get_conflict({
|
||||
'cn': groupname
|
||||
}, base_dn='ou=groups,dc=yunohost,dc=org')
|
||||
if conflict:
|
||||
raise YunohostError('group_name_already_exist', name=groupname)
|
||||
|
||||
Remove entries from LDAP
|
||||
========================
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue