models: Add can_access_all_users_group setting.

This commit adds new setting for controlling who can access
all users in the realm which would have "Everyone" and
"Members only" option.

Fixes part of #10970.
This commit is contained in:
Sahil Batra
2023-03-23 20:12:00 +05:30
committed by Tim Abbott
parent f20d427a4d
commit c82bb3ec76
13 changed files with 165 additions and 3 deletions

View File

@@ -215,6 +215,16 @@ def access_user_group_for_setting(
)
)
if (
permission_configuration.allowed_system_groups
and user_group.name not in permission_configuration.allowed_system_groups
):
raise JsonableError(
_("'{setting_name}' setting cannot be set to '{group_name}' group.").format(
setting_name=setting_name, group_name=user_group.name
)
)
return user_group