Skip to main content
Glama
rbac_config.py670 B
from __future__ import annotations import json import os from typing import Dict, Set def load_policy() -> Dict[str, Set[str]]: """Load RBAC policy from env file path or inline JSON. RBAC_POLICY_FILE: path to JSON file {role: [tools]} RBAC_POLICY_JSON: inline JSON string {role: [tools]} """ path = os.getenv("RBAC_POLICY_FILE") text = os.getenv("RBAC_POLICY_JSON") data = None if path and os.path.exists(path): with open(path, "r", encoding="utf-8") as f: data = json.load(f) elif text: data = json.loads(text) if not data: return {} return {k: set(v or []) for k, v in data.items()}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Zazzles2908/EX_AI-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server