sources/ldap: add list_flatten function to property mappings, enable on managed LDAP mappings

closes #2199

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-01-31 23:07:32 +01:00
parent a5adc4f8ed
commit e93be0de9a
4 changed files with 32 additions and 3 deletions

View File

@ -18,6 +18,17 @@ Example:
user_email_local = regex_replace(request.user.email, '(.+)@.+', '')
```
### `list_flatten(value: list[Any] | Any) -> Optional[Any}`
Flatten a list by either returning its first element, None if the list is empty, or the passed in object if its not a list.
Example:
```python
user = list_flatten(["foo"])
# user = "foo"
```
### `ak_is_group_member(user: User, **group_filters) -> bool`
Check if `user` is member of a group matching `**group_filters`.