P0+P1 fixes: RCE sandbox, SQL injection, RLS tenant isolation, DB roles, test syntax, attachment, permission registry, membership check
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
@@ -128,17 +128,31 @@ class PermissionRegistry:
|
||||
self._core_field_definitions: list[dict[str, str]] = list(CORE_FIELD_DEFINITIONS)
|
||||
|
||||
def initialize(self, active_plugin_names: set[str] | None = None) -> None:
|
||||
"""Build the registry from core permissions and active plugin manifests."""
|
||||
"""Build the registry from core permissions and active plugin manifests.
|
||||
|
||||
Preserves already-registered plugin permissions (fixes P1.3 bug where
|
||||
initialize() would wipe plugin permissions registered before startup).
|
||||
"""
|
||||
# Preserve existing plugin permissions
|
||||
existing_plugin_perms = self._plugin_permissions.copy()
|
||||
|
||||
# Reset only core permissions, keep plugin permissions
|
||||
self._permissions = {}
|
||||
self._plugin_permissions = {}
|
||||
self._active_plugins = active_plugin_names or set()
|
||||
|
||||
# Register core permissions
|
||||
for perm in CORE_PERMISSIONS:
|
||||
self._permissions[perm["key"]] = perm
|
||||
|
||||
# Re-apply plugin permissions that were registered before initialize()
|
||||
for plugin_name, perms in existing_plugin_perms.items():
|
||||
self._plugin_permissions[plugin_name] = perms
|
||||
for entry in perms:
|
||||
self._permissions[entry["key"]] = entry
|
||||
|
||||
self._initialized = True
|
||||
logger.info("Permission registry initialized with %d core permissions", len(CORE_PERMISSIONS))
|
||||
logger.info("Permission registry initialized with %d core permissions, %d plugin permissions",
|
||||
len(CORE_PERMISSIONS), len(existing_plugin_perms))
|
||||
|
||||
def register_plugin_permissions(self, plugin_name: str, permissions: list[str]) -> None:
|
||||
"""Register permissions from a plugin manifest."""
|
||||
|
||||
Reference in New Issue
Block a user