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,
|
||
|
|
)
|
||
|
|
)
|