mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 11:58:28 +02:00
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:
@@ -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(
|
||||
|
Reference in New Issue
Block a user