Curator polish (#2229)

* add new user provider hook

* account for additional logic

* add users

* remove is loading

* Curator polish

* useeffect -> provider + effect

* squash

* use use user for user default models

* squash

* Added ability to add users to groups among other things

* final polish

* added connection button to groups

* mypy fix

* Improved document set clarity

* string fixes

---------

Co-authored-by: pablodanswer <pablo@danswer.ai>
This commit is contained in:
hagen-danswer
2024-08-24 18:10:24 -07:00
committed by GitHub
parent 1e1b2a0901
commit c21b0ee3f5
32 changed files with 675 additions and 512 deletions

View File

@@ -328,10 +328,12 @@ def update_user_group(
added_user_ids = list(updated_user_ids - current_user_ids)
removed_user_ids = list(current_user_ids - updated_user_ids)
if (removed_user_ids or added_user_ids) and (
not user or user.role != UserRole.ADMIN
):
raise ValueError("Only admins can add or remove users from user groups")
# LEAVING THIS HERE FOR NOW FOR GIVING DIFFERENT ROLES
# ACCESS TO DIFFERENT PERMISSIONS
# if (removed_user_ids or added_user_ids) and (
# not user or user.role != UserRole.ADMIN
# ):
# raise ValueError("Only admins can add or remove users from user groups")
if removed_user_ids:
_cleanup_user__user_group_relationships__no_commit(