Skip to content
Snippets Groups Projects
Commit 3f8d7ef6 authored by Christoph Alt's avatar Christoph Alt
Browse files

added another kadi helper function

parent 7c1042d2
No related merge requests found
...@@ -109,6 +109,11 @@ def add_user_to_collection(manager: KadiManager, collection_id: int, user_id: in ...@@ -109,6 +109,11 @@ def add_user_to_collection(manager: KadiManager, collection_id: int, user_id: in
collection.add_user(user_id=user_id, role_name=role) collection.add_user(user_id=user_id, role_name=role)
def add_user_to_record(manager: KadiManager, record_id: int, user_id: int, *, role="admin"):
collection = manager.record(id=record_id, create=False)
collection.add_user(user_id=user_id, role_name=role)
def get_records(manager: KadiManager, record_ids: Iterable[int]): def get_records(manager: KadiManager, record_ids: Iterable[int]):
for r in record_ids: for r in record_ids:
yield manager.record(id=r, create=False) yield manager.record(id=r, create=False)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment