MCPcopy Index your code
hub / github.com/FlowiseAI/Flowise / isCheckboxDisabled

Function isCheckboxDisabled

packages/ui/src/views/apikey/APIKeyDialog.jsx:179–199  ·  view source on GitHub ↗
(permissions, category, key)

Source from the content-addressed store, hash-verified

177 }
178
179 const isCheckboxDisabled = (permissions, category, key) => {
180 if (category === 'templates') {
181 // For templates, disable marketplace and custom view if any other permission is enabled
182 if (key === 'templates:marketplace' || key === 'templates:custom') {
183 return Object.entries(permissions[category] || {}).some(
184 ([permKey, isEnabled]) => permKey !== 'templates:marketplace' && permKey !== 'templates:custom' && isEnabled
185 )
186 }
187 } else {
188 const viewPermissionKey = `${category}:view`
189 if (key === viewPermissionKey) {
190 // Disable the view permission if any other permission is enabled
191 return Object.entries(permissions[category] || {}).some(
192 ([permKey, isEnabled]) => permKey !== viewPermissionKey && isEnabled
193 )
194 }
195 }
196
197 // Non-view permissions are never disabled
198 return false
199 }
200
201 const handleSelectAll = (category) => {
202 const allSelected = permissions[category].every((permission) => selectedPermissions[category]?.[permission.key])

Callers 1

APIKeyDialogFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected