mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-11 16:08:04 -05:00
Compare commits
1 Commits
fix/resize
...
fix/copilo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eafec4fad9 |
@@ -369,7 +369,7 @@ async function processBlockMetadata(
|
||||
if (userId) {
|
||||
const permissionConfig = await getUserPermissionConfig(userId)
|
||||
const allowedIntegrations = permissionConfig?.allowedIntegrations
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockId)) {
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockId)) {
|
||||
logger.debug('Block not allowed by permission group', { blockId, userId })
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ export const getBlockConfigServerTool: BaseServerTool<
|
||||
const permissionConfig = context?.userId ? await getUserPermissionConfig(context.userId) : null
|
||||
const allowedIntegrations = permissionConfig?.allowedIntegrations
|
||||
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockType)) {
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockType)) {
|
||||
throw new Error(`Block "${blockType}" is not available`)
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export const getBlockOptionsServerTool: BaseServerTool<
|
||||
const permissionConfig = context?.userId ? await getUserPermissionConfig(context.userId) : null
|
||||
const allowedIntegrations = permissionConfig?.allowedIntegrations
|
||||
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockId)) {
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockId)) {
|
||||
throw new Error(`Block "${blockId}" is not available`)
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export const getBlocksAndToolsServerTool: BaseServerTool<
|
||||
Object.entries(blockRegistry)
|
||||
.filter(([blockType, blockConfig]: [string, BlockConfig]) => {
|
||||
if (blockConfig.hideFromToolbar) return false
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockType)) return false
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockType)) return false
|
||||
return true
|
||||
})
|
||||
.forEach(([blockType, blockConfig]: [string, BlockConfig]) => {
|
||||
|
||||
@@ -118,7 +118,7 @@ export const getBlocksMetadataServerTool: BaseServerTool<
|
||||
|
||||
const result: Record<string, CopilotBlockMetadata> = {}
|
||||
for (const blockId of blockIds || []) {
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockId)) {
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockId)) {
|
||||
logger.debug('Block not allowed by permission group', { blockId })
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ export const getTriggerBlocksServerTool: BaseServerTool<
|
||||
|
||||
Object.entries(blockRegistry).forEach(([blockType, blockConfig]: [string, BlockConfig]) => {
|
||||
if (blockConfig.hideFromToolbar) return
|
||||
if (allowedIntegrations !== null && !allowedIntegrations?.includes(blockType)) return
|
||||
if (allowedIntegrations != null && !allowedIntegrations.includes(blockType)) return
|
||||
|
||||
if (blockConfig.category === 'triggers') {
|
||||
triggerBlockIds.push(blockType)
|
||||
|
||||
Reference in New Issue
Block a user