Skip to content

Commit 032ee85

Browse files
committed
improvement(access-control): require at least one auth mode when enabled
Guard the chat-deploy and file-share auth-mode multiselects so the last allowed mode can't be removed while the feature is enabled — an empty allow-list would silently block every deployment/share. Disabling the feature entirely stays the job of the Hide Chat toggle / Public Sharing checkbox.
1 parent 25985a8 commit 032ee85

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

apps/sim/ee/access-control/components/group-detail.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,10 @@ export function GroupDetail({
11111111
)
11121112

11131113
const setFileShareAuthTypes = useCallback((values: string[]) => {
1114+
// At least one mode must stay allowed while public sharing is enabled — an
1115+
// empty allow-list would silently block every share. To turn public sharing
1116+
// off entirely, uncheck Public Sharing instead.
1117+
if (values.length === 0) return
11141118
setEditingConfig((prev) => ({
11151119
...prev,
11161120
allowedFileShareAuthTypes:
@@ -1124,6 +1128,10 @@ export function GroupDetail({
11241128
)
11251129

11261130
const setChatDeployAuthTypes = useCallback((values: string[]) => {
1131+
// At least one mode must stay allowed while chat deploy is enabled — an empty
1132+
// allow-list would silently block every chat deployment. To turn chat deploy
1133+
// off entirely, use the Hide Chat toggle instead.
1134+
if (values.length === 0) return
11271135
setEditingConfig((prev) => ({
11281136
...prev,
11291137
allowedChatDeployAuthTypes:

0 commit comments

Comments
 (0)