All checks were successful
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 18s
Test Suite / lint-backend (push) Successful in 1s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 24s
Migration 005, Registry-Sync, Placeholder-Validation, capability-geschuetzte API, Tests und Abschlussbericht v0.1. Co-authored-by: Cursor <cursoragent@cursor.com>
83 lines
1.9 KiB
Python
83 lines
1.9 KiB
Python
"""AP0.4 registry and prompt capabilities."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from rights_registry import CapabilityRegistration, register_capability
|
|
|
|
_TENANT_READ = (
|
|
("portal", "admin"),
|
|
("portal", "user"),
|
|
("tenant", "owner"),
|
|
("tenant", "admin"),
|
|
("tenant", "member"),
|
|
)
|
|
|
|
_TENANT_ADMIN = (
|
|
("portal", "admin"),
|
|
("tenant", "owner"),
|
|
("tenant", "admin"),
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.feature.registry.read",
|
|
module="feature",
|
|
description="Feature Registry lesen",
|
|
default_grants=_TENANT_READ,
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.feature.registry.manage",
|
|
module="feature",
|
|
description="Feature Registry verwalten (Sync/Metadaten)",
|
|
default_grants=(("portal", "admin"),),
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.prompt.registry.read",
|
|
module="prompt",
|
|
description="Prompt Registry lesen",
|
|
default_grants=_TENANT_READ,
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.prompt.registry.manage",
|
|
module="prompt",
|
|
description="Prompt Registry verwalten",
|
|
default_grants=(("portal", "admin"),),
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.config.registry.read",
|
|
module="config",
|
|
description="Configuration Registry lesen",
|
|
default_grants=_TENANT_ADMIN,
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.config.registry.manage",
|
|
module="config",
|
|
description="Configuration Registry schreiben",
|
|
default_grants=_TENANT_ADMIN,
|
|
)
|
|
)
|
|
|
|
register_capability(
|
|
CapabilityRegistration(
|
|
key="kairo.prompt.render",
|
|
module="prompt",
|
|
description="Prompts rendern (ohne LLM)",
|
|
default_grants=_TENANT_READ,
|
|
)
|
|
)
|