MCPcopy Index your code
hub / github.com/simstudioai/sim / getPermissionErrorMessage

Function getPermissionErrorMessage

apps/sim/lib/mcp/middleware.ts:223–234  ·  view source on GitHub ↗

* Get appropriate error message for permission level

(permissionLevel: McpPermissionLevel)

Source from the content-addressed store, hash-verified

221 * Get appropriate error message for permission level
222 */
223function getPermissionErrorMessage(permissionLevel: McpPermissionLevel): string {
224 switch (permissionLevel) {
225 case 'read':
226 return 'Workspace access required for MCP operations'
227 case 'write':
228 return 'Write or admin permission required for MCP server management'
229 case 'admin':
230 return 'Admin permission required for MCP server administration'
231 default:
232 return 'Insufficient permissions for MCP operation'
233 }
234}
235
236/**
237 * Higher-order function that wraps MCP route handlers with authentication middleware

Callers 1

validateMcpAuthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected